xsl-list
[Top] [All Lists]

Re: Fw: Root Node and apply-templates

2003-04-07 08:22:39
Oscar,

You may want to change the xml encoding to UTF-8 or UTF-16.  All xslt
processors must conform to those two encodings.  Otherwise, you will need to
ensure that your xslt processor can process ISO-8859-1.

In addition, it appears as though you have an improper processing
instruction:

<?xml:stylesheet type="text/xsl"
href="/BKM/BKMDesarrollo/admin/showSrchTemplate.xsl"?>

should be:

<?xml-stylesheet type="text/xsl"
href="/BKM/BKMDesarrollo/admin/showSrchTemplate.xsl"?>

finally, it appears as though you have two lines:
</xsl:temaplate>

which ought to be:
</xsl:template>

I'm assuming that you have more xsl within the part that says 'display data'
otherwise all you're going to get is 5 iterations of the phrase 'display
data' on your output line.

bix


----- Original Message -----
From: "Oscar" <ocaraballo(_at_)www(_dot_)baratz(_dot_)es>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, April 07, 2003 9:54 AM
Subject: [xsl] Fw: Root Node and apply-templates



I dont know if this is a very simple question but im a bit confused:

I have this xml:


<?xml version="1.0" encoding="ISO-8859-1" ?><?xml:stylesheet
type="text/xsl"
href="/BKM/BKMDesarrollo/admin/showSrchTemplate.xsl"?>

<ROOT CgiWebXcon="/cgi-bin/BKM/BKMDesarrollo/idccgi/X8102/ID25880"
idioma="admproperties_es_ES.xml" system="SAMP" >
<FIELDS>
<FIELD tipo="0" sname="DOCN" >BRS Assigned Accession Number</FIELD>
<FIELD tipo="0" sname="TI" >Title</FIELD>
<FIELD tipo="0" sname="TX" activated="true" >Texto</FIELD>
<FIELD tipo="0" sname="CR" activated="true" >Referencias</FIELD>
<FIELD tipo="0" sname="SHRT" activated="true" >DOCN</FIELD></FIELDS>
</ROOT>

and i do somethign like this:

<xsl:template match="/">
    <xsl:apply-templates select="/ROOT/FIELDS/FIELD"/>
</xsl:temaplate>

<xsl:template match="FIELD">
    display data
</xsl:template>


but this doesnt work,  otherwise this code works:

<xsl:template match="/">
    <xsl:call-template name="test"/>
</xsl:temaplate>

<xsl:template name="test">
    <xsl:apply-templates select="/ROOT/FIELDS/FIELD"/>
</xsl:temaplate>

<xsl:template match="FIELD">
    display data
</xsl:template>



why?



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



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