I've got a situation where a webpage has something like:
<div id="main">
<div id="item1">
</div>
<div id="item2">
</div>
</div>
Is TextPipe something I could use to grab this whole nested structure and write it to a separate file?
Thanks
Nested XML?
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Nested XML?
Sure - just use an EasyPattern like this:
<div id="main">
<div id="item1">[ capture(1+chars) ]</div>
<div id="item2">[ capture(1+chars) ]</div>
</div>
<div id="main">
<div id="item1">[ capture(1+chars) ]</div>
<div id="item2">[ capture(1+chars) ]</div>
</div>
-
- Posts: 2
- Joined: Wed Jan 21, 2009 12:23 am
Re: Nested XML?
I see... how about if sometimes there is item1 and item2, and sometimes there's just item1?
Thanks!
Thanks!
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Nested XML?
Then try:
<div id="main">
<div id="item1">[ capture(1+chars) ]</div>[ 0+ whitespace, longest optional( '<div id="item2">', capture(1+chars), '</div>' ), 0+ whitespace ]</div>
<div id="main">
<div id="item1">[ capture(1+chars) ]</div>[ 0+ whitespace, longest optional( '<div id="item2">', capture(1+chars), '</div>' ), 0+ whitespace ]</div>