xml editor

Products

Features

  EPUB
Supported platforms

Supports Windows 7 & Mac OS X Lion

Ready for XML Editor data server software
W3C Member

Search for xml tags with line break

Questions about XML that are not covered by the other forums should go here.

Search for xml tags with line break

Postby jeofree » Tue May 03, 2011 6:00 am

This will be a newbie question so bear with me:

How can I use Oxygen to search a collection of DITA xml files for <ul or <ol occurrences only after a closing paragraph tag-- even if on the next line? In other words, finding all instances of this:


Code: Select all
</p>
    <ol

I just want to find places where either unordered or ordered lists have been started outside of the paragraph instead of inside it, and having no luck using regular expressions to find it because of the line break.

Please give as much detail as you can if responding.

Thanks,
jeofree
 
Posts: 5
Joined: Tue May 03, 2011 5:54 am

Re: Search for xml tags with line break

Postby adrian » Wed May 04, 2011 4:05 pm

Hello,

Use the Find Replace in Files dialog with the following settings.
1. Text to find:
Code: Select all
(<ul|<ol)

2. Enable "Regular expression".
3. Restrict to XPath:
Code: Select all
//(ul|ol)[name(preceding-sibling::*[1])='p']

4. Scope: the folder or selection of your DITA files.

What the XPath does is: It looks for all ul and ol elements(//(ul|ol)) which have the first preceding element(preceding-sibling::*[1]) named 'p'(name(...)='p').

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
adrian
 
Posts: 979
Joined: Tue May 17, 2005 4:01 pm

Re: Search for xml tags with line break

Postby jeofree » Wed May 04, 2011 7:11 pm

Adrian,

Thanks, that's perfect.
jeofree
 
Posts: 5
Joined: Tue May 03, 2011 5:54 am


Return to General XML Questions

Who is online

Users browsing this forum: No registered users and 0 guests

XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>® XML Editor