[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: If XML is too hard for a programmer, perhaps he'd b e

  • To: xml-dev@l...
  • Subject: Re: If XML is too hard for a programmer, perhaps he'd b e better off as a crossing guard
  • From: "Simon St.Laurent" <simonstl@s...>
  • Date: Mon, 31 Mar 2003 14:14:50 -0500
  • In-reply-to: <3E8890E6.1080700@t...>

Re:  If XML is too hard for a programmer
tbray@t... (Tim Bray) writes:
>> I'm currently writing code for selectively inserting and removing
>> CDATA sections from documents, largely because a a certain
>> data-centric piece of software insists on adding them any time I try
>> to use markup in its fields.  It is an exercise in silliness, but
>> sometimes that silliness comes from the data side.
>
>Couldn't you just run it through Perl's XML::Parser or equivalent?  

I don't think so, unless XML::Parser has added functionality way beyond
expat's core - which tells me a CDATA section is starting or ending but
doesn't let me scream "IGNORE THAT CDATA SECTION MARKER AND PARSE THE
DAMN CONTENT NORMALLY!" 

I'm in the classically stupid position where the export is generating:

<root>
...
<repeatingNode1><![CDATA[This is in <b>bold</b>, or at least it should
be.]]></repeatingNode1>
<repeatingNode2>content</repeatingNode2>
....
</root>


and what I actually want is:
<root>
...
<repeatingNode1>This is in <b>bold</b>, or at least it should
be.</repeatingNode1>
<repeatingNode2>content</repeatingNode2>
....
</root>


More creatively, there may also be times where the use of CDATA sections
is appropriate, so simply nuking all of them isn't the right answer
either.  Fixing these kinds of things takes a bit of work, which is what
I'm doing at the moment.

-- 
Simon St.Laurent
Ring around the content, a pocket full of brackets
Errors, errors, all fall down!
http://simonstl.com -- http://monasticxml.org

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.