This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
create new output elements
- To: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] create new output elements
- From: Bruce Rosborough <BRosborough at XOL dot com>
- Date: Wed, 28 Mar 2001 16:46:45 -0600
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi. My thanks to those people who reponded to my previous thread and tried
to help. I've tried the suggestions but unfortunately do not yet get the
desired results. Attempting to use "name" is still ignored for reasons
unknown. As suggested, I also upgraded to MS XML Parser 3.0 for Internet
Explorer 5.01 browsing, as the link to the netcrucible website was very
helpful.
Here is the problem. Thanks in advance.
XML input (text lines of various types):
<?xml version='1.0' ?>
<?xml:stylesheet type="text/xsl" href="farerules.xsl"?>
<FareRules>
<PenRules>this text is penalty rules text</PenRules>
<MinStay>this text is minimum stay text</MinStay>
<PenRules>this text is penalty rules2 text</PenRules>
<MaxStay>this text is maximum stay text</MaxStay>
</FareRules>
desired XML output: (text lines categorized, using new element names and
adding new element for group)
<Text>
<PenaltyRules>this text is penalty rules text</PenaltyRules>
<PenaltyRules>this text is penalty rules2 text</PenaltyRules>
<MinimumStay>this text is minimum stay text</MinimumStay>
<MaximumStay>this text is maximum stay text</MaximumStay>
</Text>
actual XML output via using XSL file below (using Internet Explorer 5.01 and
MS XML Parser 3.0)
this text is penalty rules text this text is penalty rules2 text this text
is minimum stay text this text is maximum stay text
XSL file (used unsuccessfully to try to transform this, aka
'faresrules.xsl')
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="FareRules">
<xsl:element name="Text">
<xsl:apply-templates select="PenRules"/>
<xsl:apply-templates select="MinStay"/>
<xsl:apply-templates select="MaxStay"/>
</xsl:element>
</xsl:template>
<xsl:template match="PenRules">
<xsl:element name="PenaltyRules">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="MinStay">
<xsl:element name="MinimumStay">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
<xsl:template match="MaxStay">
<xsl:element name="MaximumStay">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Thanks again.
Best regards,
Bruce
BRosborough@xol.com
www.xol.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list