[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: commenting an XML element [XSLT 1.0][xsltproc]

Subject: Re: commenting an XML element [XSLT 1.0][xsltproc]
From: pankaj.c@xxxxxxxxxxxxxxxxxx
Date: Wed, 18 Aug 2010 18:04:51 +0530
Re:  commenting an XML element [XSLT 1.0][xsltproc]
Thanks everybody for your thoughts.
Martin, just for the brevity below is the snippet of my sample xml, which 
is a table and <spec/> is actually is <colspec/> (copy pasted from the 
wrong snippet earlier)

<?xml version="1.0" encoding="UTF-8"?>
<!-- New document created with EditiX at Wed Aug 18 17:37:11 IST 2010 -->
<table id="t0010" frame="topbot" rowsep="0" colsep="0">
<label>Table 3-1</label>
<caption>
<simple-para id="sp0200" role="title">This is a dummy title.</simple-para>
<simple-para id="sp0210">Ranjan</simple-para>
</caption>
<source>Source if present.</source>
<tgroup cols="2">
<colspec colname="col1"/>
<colspec colname="col2"/>
<thead valign="top">
<row>
<entry rowsep="1" align="left">Abbreviation</entry>
<entry rowsep="1" align="left">Dosage Interval</entry>
</row>
</thead>
<!-- More code here 
-->
</tgroup>
</table>

Stylesheet snippet is same as posted earlier and  I just tried using 
"XALAN" in editix2010sp1 and got the following error. 

Error:
==================================
No character data is allowed between top-level elements
No character data is allowed between top-level elements
No character data is allowed between top-level elements
No character data is allowed between top-level elements

Failed to compile stylesheet. 4 errors detected.

If I select the first error it highlights line
<entry rowsep="1" align="left">Dosage Interval</entry>

I am not sure but possibly my processing of entry element in stylesheet is 
causing problem, which looks like below:

<xsl:template match="table//entry">
        <xsl:copy>
        <xsl:attribute name="table_type">cell</xsl:attribute>
        <xsl:choose>
                <xsl:when test="name(ancestor::*)='thead'">
                        <xsl:attribute name="theader"/>  
                        <xsl:attribute 
name="cellstyle">thead_cell</xsl:attribute>
                        <xsl:attribute name="valign">top</xsl:attribute>
                </xsl:when>
        </xsl:choose>
        <xsl:copy-of select="@*"/>
        <xsl:apply-templates/>
        </xsl:copy>
 
</xsl:template>

Any thoughts please.

Please let me know if the snippets are not enough to understand the issue.

Best,
Pankaj

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.