Re: [xsl] Create several XML files

Subject: Re: [xsl] Create several XML files
From: "M. David Peterson" <m.david.x2x2x@xxxxxxxxx>
Date: Mon, 22 Nov 2004 12:58:59 -0800
Two concatenated XML files (each being well formed in their own
regard) would equal one non-well-formed XML file so thats not going to
work for you either.  Who on earth is joining XML files and giving
them to you in such a format anyway?  I feel for you on this one... 
that bites!

While converting non-well formed XML to well formed XML takes more
than a box of matches and some superglue (don't ask :) it seems that
if there were two or more to start with and they are simply conjoined
via a CDATA section (huh?  I guess theres a reason people do things
although I can't see a good one in this scenario) then just rip open a
can of your favorite brand of RegEx (use javascript if you have to)
and ripem apart at the seams...  Heck, if you used IE you could even
load the result as an XML data fragment and process it from there...

Seems to me theres gotta be a solution thats going to work although an
XML parser is not one of them...  Unless your explanation of your
conjoined XML is either misrepresented by you or misunderstood by me
then you most definitely will have parsing issues from the get go...

Best of luck!

<M:D/>


On Mon, 22 Nov 2004 20:36:40 -0000, George James
<georgej@xxxxxxxxxxxxxxx> wrote:
> Michael
> > ... but you'll need some software
> > that extracts them ...
> 
> That is a non-trivial problem.  Given that a CDATA section within an XML
> file could contain whatever string is used to delimit the two files (in this
> case a blank line and a pi), the only sure-fire way to split up two
> concatenated xml files would be to parse the first one as an XML file.
> 
> So while you say that you can't expect an XML parser to do this, you can't
> expect to be able to do it with something that *isn't* an XML parser either!
> 
> It would seem the best advice is not to concatenate XML files in the first
> place, although this may be outside the control of the op.
> 
> Regards
> George
> 
> Tools, Training, Technology
> www.georgejames.com
> +44-1932-252568
> 
> 
> 
> 
> > -----Original Message-----
> > From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
> > Sent: 22 November 2004 17:42
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: RE: [xsl] Create several XML files
> >
> >
> > > I have a xml file (Response.xml) and it has several
> > > xml documents into it, like this:
> >
> >
> > There's no absolute reason why you can't store several XML
> > documents in a single file, but you'll need some software
> > that extracts them and presents them to the XML parser one at
> > a time, and I'm not aware of any off-the-shelf software that
> > does that. Certainly you can't expect an XML parser to do it.
> > And of course you can't transform a document until you can parse it.
> >
> > Michael Kay
> > http://www.saxonica.com/
> 
> 


-- 
<M:D/>

:: M. David Peterson
:: XML & XML Transformations, C#, .NET, and Functional Languages Specialist
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Founding member of x2x2x.org community of XML development professionals
:: Current x2x2x.org projects: Saxon.NET, AspectXML, xameleon, LLUP,
:: WWULF, WeblogServices(WeBLS-*), and several new unannounced projects.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [Contact] :: m.david@xxxxxxxxxx :: m.david@xxxxxxxxx :: 206.331.3851
:: [Web] :: http://www.mdptws.com :: http://www.x2x2x.org :: http://wwxml.com
:: [Weblog] :: http://www.xsltblog.com :: http://www.mdavidpeterson.com ::

Current Thread