[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] is it possible to construct new xml with xsl ?


Subject: Re: [xsl] is it possible to construct new xml with xsl ?
From: Meir <umen@xxxxxxxxxxxxxxxx>
Date: Mon, 17 Jun 2002 10:46:37 -0700

Hello Thank for the reply
but what i meant was this : say i have this :
******************************** THE XML *******************************
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="myxsl.xsl"?>
<students>
 <male>
  <age>20</age>
  <name>shlomi</name>
 </male>
 <male>
  <age>26</age>
  <name>nadav</name>
 </male>
</students>


******************************** THE XSL *******************************
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">

<![CDATA[<?xml version="1.0"?>]]>
<![CDATA[<myroot>]]>

<xsl:for-each select="students/male">
<![CDATA[<thestudent>]]>
<![CDATA[<theage>]]>
<xsl:value-of select="age"/>
<![CDATA[</theage>]]>

<![CDATA[<thename>]]>
<xsl:value-of select="name"/>
<![CDATA[</thename>]]>
<![CDATA[</thestudent>]]>
</xsl:for-each>

<![CDATA[</myroot>]]>
</xsl:template>
</xsl:stylesheet>

the output of this xsl/xml is:
<?xml
version="1.0"?><myroot><thestudent><theage>20</theage><thename>shlomi</thena
me></thestudent><thestudent><theage>26</theage><thename>nadav</thename></the
student></myroot>

that is ok , but its not loading as xml file ....
so here i have half job done all i need to know how i can make IE to
load/parse it as xml file . whitout saveing it first to xml file..
thanks






----- Original Message -----
From: "Mike Brown" <mike@xxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Sunday, June 16, 2002 12:17 PM
Subject: Re: [xsl] is it possible to construct new xml with xsl ?


> Meir wrote:
> > is there any way to construct new xml file from given xml file
> > with xsl
>
> This is the most basic use of XSLT, transforming one XML document into
> another. Read any XSLT tutorial.
>
> > when i load the xml file with the xsl file linked to it i will see
> > in the IE new construction with the "+" and"-"
>
> IE will assume the output of the transformation is meant to be interpreted
as
> HTML. If you want collapsible views, you need to use a stylesheet that
will
> produce the (D)HTML that makes the browser produce the view you want. See
>   http://www.dpawson.co.uk/xsl/sect2/microsoft.html#d58e229
>
>    - Mike
>
____________________________________________________________________________
>   mike j. brown                   |  xml/xslt: http://skew.org/xml/
>   denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>



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



Current Thread
Keywords