Nested XML?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

pfisterfarm
Posts: 2
Joined: Wed Jan 21, 2009 12:23 am

Nested XML?

Postby pfisterfarm » Wed Jan 21, 2009 12:28 am

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

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Nested XML?

Postby DataMystic Support » Thu Jan 22, 2009 3:03 pm

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>
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

pfisterfarm
Posts: 2
Joined: Wed Jan 21, 2009 12:23 am

Re: Nested XML?

Postby pfisterfarm » Fri Jan 23, 2009 2:28 am

I see... how about if sometimes there is item1 and item2, and sometimes there's just item1?

Thanks!

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Nested XML?

Postby DataMystic Support » Sat Jan 24, 2009 8:48 am

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>
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 5 guests