xsl-list
[Top] [All Lists]

Re: Create several XML files

2004-11-22 19:51:11
Oohhh... nice solution Wendell! It never occured to me.. this is EXCELLENT!!!

BTW...Rumor has it that you put on quite the show... in fact award
winning if I understand correctly? ... I've heard the title and am
DIEING to see the slides and demo!!!! Any chance of obtaining access
to the post-show replay?

Thanks for this little tidbit! If you were not aware I finally got one
of my sites, XSLTBlog.com, up and running (more to come very soon!)...
this is just the little tricks of the trade type thing that I feel
demands presence on the site... I hope you don't mind if I post this,
giving full credit of course!?

Congratulations on an obvious job well done at the XML conference!

Cheers!

<M:D/>


On Mon, 22 Nov 2004 18:31:56 -0500, Wendell Piez
<wapiez(_at_)mulberrytech(_dot_)com> wrote:
Depending on what's actually in the two-or-more concatenated XML documents
in a single file, it may constitute a well-formed external parsed entity,
and can be parsed as such.

That is, if we have in dox.xml (which does not parse as XML):

<?xml version='1.0'?>
<doc>...</doc>
<doc>...</doc>
<doc>...</doc>

the entirety can be parsed if it is called into a shell or "wrapper"
document like so:

<!DOCTYPE wrapper [
<!ENTITY content SYSTEM "dox.xml">
]>
<wrapper>
  &content;
</wrapper>

... which can be parsed (and processed with XSLT, which could be used to
split the pieces back out).

If there are XML declarations sprinkled throughout, as in

<?xml version='1.0'?>
<doc>...</doc>
<?xml version='1.0'?>
<doc>...</doc>
<?xml version='1.0'?>
<doc>...</doc>

... then you have to work a little harder. (Some less-than-conformant
parsers may not care about those errant XML declarations, thinking they're
processing instructions; but most will.) Pre-processing to remove or alter
them would work, but if you could identify them dependably, you could as
easily split the files at that point and not have the problem. (You could
alter them to something innocuous like a PI, parse the file and then use
XSLT to clean up the mess, but that would be embarrassing: I wouldn't
announce it to the list if I were planning that.)

If the demarcators aren't XML declarations but really PIs:

<?xml version='1.0'?>
<doc>...</doc>
<?separator?>
<doc>...</doc>
<?separator?>
<doc>...</doc>

then it would work to wrap the file into an entity.

That is, how hard you have to work very much depends on the particulars of
the format of the concatenation.

Have we been told exactly those particulars?

Cheers,
Wendell


 At 03:58 PM 11/22/2004, M.D. wrote:
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!


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

--~------------------------------------------------------------------


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)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(_dot_)david(_at_)mdptws(_dot_)com :: 
m(_dot_)david(_at_)x2x2x(_dot_)org :: 206.331.3851
:: [Web] :: http://www.mdptws.com :: http://www.x2x2x.org :: http://wwxml.com
:: [Weblog] :: http://www.xsltblog.com :: http://www.mdavidpeterson.com ::

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>