OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] If XML is too hard for a programmer, perhaps he'd b e

[ Lists Home | Date Index | Thread Index ]
  • To: "Simon St.Laurent" <simonstl@simonstl.com>,<xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] If XML is too hard for a programmer, perhaps he'd b e better off as a crossing guard
  • From: "Dare Obasanjo" <dareo@microsoft.com>
  • Date: Mon, 31 Mar 2003 14:34:55 -0800
  • Thread-index: AcL3uegcOWpfOGfwTAq6sRvvfhyYKwAG60nQ
  • Thread-topic: [xml-dev] If XML is too hard for a programmer, perhaps he'd b e better off as a crossing guard

Interesting, so in this application can you guarantee that all the HTML
that is being placed in CDATA sections is always going to be valid XHTML
(ignoring the lack of DocType decl and namespace declaration)?

-- 
PITHY WORDS OF WISDOM 
Experience is something you don't get until just after you need it.


This posting is provided "AS IS" with no warranties, and confers no
rights. 

>  
>  
> -----Original Message-----
> From: Simon St.Laurent [mailto:simonstl@simonstl.com] 
> Sent: Monday, March 31, 2003 11:15 AM
> To: xml-dev@lists.xml.org
> 
> tbray@textuality.com (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
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org 
> <http://www.xml.org>, an initiative of OASIS 
> <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
> 
> 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS