xsl-list
[Top] [All Lists]

Re: RE: How to get output XML same as input XML?

2003-07-12 23:58:20
Judging from what you wrote, nobody in this group could really help you,
unless you first spent the time to read a good book on XSLT.

Reading Jeni's "Beginning XSLT" and Mike's "XSLT Programmer's Reference"
will save a lot of time and confusion.

Then probably you'd have solved your current problem and would be able to
formulate problems that are meaningful in the context of XSLT.


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL



"Josh Hone" <icsad(_at_)hotmail(_dot_)com> wrote in message
news:Law8-F32bKP7Ie8tlMa00003a7f(_at_)hotmail(_dot_)com(_dot_)(_dot_)(_dot_)
Hi all -

First, let me thank you all for the helpful advice.  Other mailing boards
I
have been on are usually much less helpful (see Jetspeed....).  Second,
let
me explain my app a little better, and tell you about a problem I had with
xsl:copy (i did not try xsl:copy-of).  In the XML I am dealing with, I
always have two child elements of the root element which I parse with two
different stylesheets.  Since the stylesheets cannot be loaded
dynamically,
I do the separate parsing in my Xalan code.  The stylesheets are
identified
by an attribute on each child element of the root node.  Once the
stylesheets parse the input XML, the result gets streamed into the same
file, one child element of the root node on top of the other.  So, if I am
going to create a valid XML document from this, I need to open an element
in
one template but close it in another template describing the other child
element.

xsl:copy would not put the namespace definition for one of my attributes.
Specifically, one of the child elements of the root node of the original
XML
document would have attributes from another namespace than the one that
the
element is defined under.  xsl:copy does not provide a definition of the
namespace of the attributes which belong to other namespaces.
Specifically,
the namespaces of the attributes were defined in the root element.  I
suspect that is why xsl:copy fails to make a valid document in this case,
since a straight copy doesn't include a definition of something defined
outside the stylesheet.  But I am not sure.  As I said, I did not try
xsl:copy-of.

I ended up creating a Perl script as the output of the stylesheets and
using
ASCII characters to write the opening tag in one template and a closing
tag
in another.  The Perl script writes the XML to a file, including resolving
the ASCII codes, producing a valid document with essentially two wrapped
child elements of the former root node.  An example result document is at:


http://hnpux3.physics.fsu.edu/~hone/hnpuxpadmin_2003-07-12_10-17-11.959.xml

with the stylesheets which produced this document referenced therein.

Thanks again and I will respond to any questions,
Josh Hone

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list






 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list