Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 17th, 2016, 06:29 AM
Authorized User
 
Join Date: Nov 2016
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Element name have dot

Hi,

I have faced one problem during creating new element. element name have dot(.) present but it is an valid element and cross check with DTD also. (example: rx.list)

I directly created same element rx.list in my XSLT. But it's working one portion the same template applicable but some of the portion is missing.

I have simply check before creating the element <rx.list> the whole content is come perfectly. when I start to create the element after that some of the portion missing in transformation..

Anyone please Help me...

Example:

<xsl:template match="p[not(@class)]">
<xsl:choose>
<xsl:when test="not(child::ptext) and matches(normalize-space(.),'^\d+\.\d')">

<rx.list type="num">
<xsl:attribute name="after">)</xsl:attribute>
<xsl:attribute name="before">(</xsl:attribute>
<xsl:attribute name="column">1</xsl:attribute>
<rx.li>
<rx.text>
<xsl:choose>
<xsl:when
test="matches(.,'^[0-9]+\.[0-9]+\.')">
<xsl:call-template name="span">
<xsl:with-param name="node" select="*"></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>

<xsl:call-template name="span">
<xsl:with-param name="node" select="*"></xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</rx.text>
</rx.li>
</rx.list>
</xsl:when>

Thanks,
bharathi
 
Old November 17th, 2016, 06:58 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's nothing wrong with having a "." in an element name, it's just like any other character. Unless there's a bug in your XSLT processor, this is not the cause of your problem.

It's not clear from your post what your problem is. As well as the XSLT code, you should show sample input, expected output, and actual output.

You regular expression test="matches(.,'^[0-9]+\.[0-9]+\.') looks strange to me but without having any idea what the input and expected output of the transformation is, I have no way of knowing whether it is right or wrong.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 17th, 2016, 07:35 AM
Authorized User
 
Join Date: Nov 2016
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Post

Quote:
Originally Posted by mhkay View Post
There's nothing wrong with having a "." in an element name, it's just like any other character. Unless there's a bug in your XSLT processor, this is not the cause of your problem.

It's not clear from your post what your problem is. As well as the XSLT code, you should show sample input, expected output, and actual output.

You regular expression test="matches(.,'^[0-9]+\.[0-9]+\.') looks strange to me but without having any idea what the input and expected output of the transformation is, I have no way of knowing whether it is right or wrong.
Thanks Sir. but i just change the name of the element rx-list instead of rx.list
i am getting an exact full content.. here placed the sample input and output.

Please check the output the rx-li list item missing after the table

please check and help me...

INPUT Html:

<html>
<body>
<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span>1.1.</span>

</span>

<span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span>

<span style="font-size:10pt">That until further Order, the Applicant shall be referred to in all documentation in the proceedings and in the Court as “X”, and no information identifying the Applicant as the Applicant in the proceeding shall be publicly disclosed or disseminated.</span>

</p>

<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span>1.2.</span>

</span>

<span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span>

<span style="font-size:10pt">That the Court file insofar as it discloses the identity of the Applicant shall not be made available for public inspection.</span>

</p>

<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span>1.3.</span>

</span>


<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span>

<span style="font-size:10pt">That leave to amend the title to the proceeding to give effect to the Order in paragraph</span>

<span style="font-size:10pt">&#xa0;</span>

<span style="font-size:10pt">(1) be granted.</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">DISTRICT REGISTRAR</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">Date Entered:</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">[</span>

<span style="font-style:italic">For formal document headings, see guide card “Federal Court Forms” at </span>

<span class="LC-Externalreference">[50,001]</span>

<span class="LC-Externalreference" style="font-size:7pt; vertical-align:super">:id=d10474e1641</span>

<span style="font-size:10pt">]</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">Form 47</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">ORDER</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">(Order 36)</span>

</p>

<table cellspacing="0" cellpadding="0" style="border-collapse:collapse; margin-left:5.4pt; width:450.4pt">

<tr>

<td style="border-right-color:#000000; border-right-style:solid; border-right-width:0.5pt; vertical-align:top; width:237.5pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:center">

<span style="font-family:'Times New Roman'; font-size:10.5pt">&#xa0;</span>

</p>

</td>

<td style="border-left-color:#000000; border-left-style:solid; border-left-width:0.5pt; vertical-align:top; width:230.45pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:center">

<span style="font-family:'Times New Roman'; font-size:10.5pt">&#xa0;</span>

</p>

</td>

</tr>

<tr>

<td style="border-right-color:#000000; border-right-style:solid; border-right-width:0.5pt; vertical-align:top; width:237.5pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:left">

<span style="font-family:'Times New Roman'; font-size:10.5pt">JUDGE:</span>

</p>

</td>

<td style="border-left-color:#000000; border-left-style:solid; border-left-width:0.5pt; vertical-align:top; width:230.45pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:left">

<span style="font-family:'Times New Roman'; font-size:10.5pt">Justice Denning</span>

</p>

</td>

</tr>

<tr>

<td style="border-right-color:#000000; border-right-style:solid; border-right-width:0.5pt; vertical-align:top; width:237.5pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:left">

<span style="font-family:'Times New Roman'; font-size:10.5pt">DATE OF ORDER:</span>

</p>

</td>

<td style="border-left-color:#000000; border-left-style:solid; border-left-width:0.5pt; vertical-align:top; width:230.45pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:left">

<span style="font-family:'Times New Roman'; font-size:10.5pt">1 February 2011</span>

</p>

</td>

</tr>

<tr>

<td style="border-right-color:#000000; border-right-style:solid; border-right-width:0.5pt; vertical-align:top; width:237.5pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:left">

<span style="font-family:'Times New Roman'; font-size:10.5pt">WHERE MADE:</span>

</p>

</td>

<td style="border-left-color:#000000; border-left-style:solid; border-left-width:0.5pt; vertical-align:top; width:230.45pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:left">

<span style="font-family:'Times New Roman'; font-size:10.5pt">Melbourne</span>

</p>

</td>

</tr>

<tr>

<td style="border-right-color:#000000; border-right-style:solid; border-right-width:0.5pt; vertical-align:top; width:237.5pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:center">

<span style="font-family:'Times New Roman'; font-size:10.5pt">&#xa0;</span>

</p>

</td>

<td style="border-left-color:#000000; border-left-style:solid; border-left-width:0.5pt; vertical-align:top; width:230.45pt">

<p class="L-Tablecontent" style="line-height:13.5pt; margin-bottom:6pt; text-align:center">

<span style="font-family:'Times New Roman'; font-size:10.5pt">&#xa0;</span>

</p>

</td>

</tr>

</table>

<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span>1.4.</span>

</span>

<span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span>

<span style="font-size:10pt">That until further Order, the Applicant shall be referred to in all documentation in the proceedings and in the Court as “X”, and no information identifying the Applicant as the Applicant in the proceeding shall be publicly disclosed or disseminated.</span>

</p>

<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span>1.5.</span>

</span>

<span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span>

<span style="font-size:10pt">That the Court file insofar as it discloses the identity of the Applicant shall not be made available for public inspection.</span>

</p>

<p style="margin-left:39.6pt; text-indent:-21.6pt">

<span style="font-size:8pt">

<span>1.6.</span>

</span>

<span style="font:7.0pt 'Times New Roman'">&#xa0;&#xa0;&#xa0;&#xa0;&#xa0; </span>

<span style="font-size:10pt">That leave to amend the title to the proceeding to give effect to the Order in paragraph</span>

<span style="font-size:10pt">&#xa0;</span>

<span style="font-size:10pt">(1) be granted.</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">DISTRICT REGISTRAR</span>

</p>

<p class="L-Reprotext">

<span style="font-size:10pt">Date Entered:</span>

</p>

<p class="LM-ProcessingInstruction">

<span>&lt;fascicle nextpg="95,001" servnumber="0"&gt;</span>

</p>

<p class="LC-Externalreference" style="border-bottom-color:#000000; border-bottom-style:solid; border-bottom-width:0.75pt; padding-bottom:1pt">

<span>&#xa0;</span>

</p>

<p style="margin-left:72pt; margin-right:72pt">

<span style="font-weight:bold">Cross-reference metadata (do not edit)</span>

</p>

</body>
</html>
_________________________________________________
XSLT:

<xsl:template match="p[not(@class)]">
<xsl:choose>
<xsl:when test="not(child::ptext) and matches(normalize-space(.),'^\d+\.\d')">

<rx.list type="num">
<xsl:attribute name="after">)</xsl:attribute>
<xsl:attribute name="before">(</xsl:attribute>
<xsl:attribute name="column">1</xsl:attribute>
<rx.li>
<rx.text>
<xsl:choose>
<xsl:when
test="matches(.,'^[0-9]+\.[0-9]+\.')">


<xsl:call-template name="span">
<xsl:with-param name="node" select="*"></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="span">
<xsl:with-param name="node" select="*"></xsl:with-param>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</rx.text>
</rx.li>
</rx.list>
</xsl:when>



<xsl:when test="not(child::ptext)">
<p>
<ptext>
<xsl:call-template name="span">
<xsl:with-param name="node" select="*"></xsl:with-param>
</xsl:call-template>
</ptext>
</p>
</xsl:when>

<xsl:otherwise>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
___________________________________________
Output:

<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>(Order 36)</rx.text>
<rx.list type="num" after=")" before="(" column="1">
<rx.li>
<rx.text>1.1. That until further Order, the Applicant shall be referred to in all documentation in the proceedings and in the Court as “X”, and no information identifying the Applicant as the Applicant in the proceeding shall be publicly disclosed or disseminated.</rx.text>
</rx.li>
<rx.li>
<rx.text>1.2. That the Court file insofar as it discloses the identity of the Applicant shall not be made available for public inspection.</rx.text>
</rx.li>
<rx.li>
<rx.text>1.3. That leave to amend the title to the proceeding to give effect to the Order in paragraph (1) be granted.</rx.text>
</rx.li>
</rx.list>
</rx.p>
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>DISTRICT REGISTRAR</rx.text>
</rx.p>
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>Date Entered:</rx.text>
</rx.p>
<rx.p>
<rx.text>[<emphasis shading="nil" type="ital">For formal document headings, see guide card “Federal Court Forms” at </emphasis>
<xref xrefid="FCLP.FCF.FCR.SCH1.F1" link-to="oth" leg-code="FCR" doc-code="FCLP"
link="y"
newwindow="yes">[50,001]</xref>]</rx.text>
</rx.p>
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>Form 47</rx.text>
</rx.p>
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>ORDER</rx.text>
</rx.p>
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>(Order 36)</rx.text>
</rx.p>
</repro-tx>
<p>
<table frame="none" colsep="0" rowsep="0">
<tgroup cols="2">
<colspec colname="col1" colwidth="1*"/>
<colspec colname="col2" colwidth="1*"/>
<tbody>
<row>
<entry align="center"> </entry>
<entry align="center"> </entry>
</row>
<row>
<entry align="left">JUDGE:</entry>
<entry align="left">Justice Denning</entry>
</row>
<row>
<entry align="left">DATE OF ORDER:</entry>
<entry align="left">1 February 2011</entry>
</row>
<row>
<entry align="left">WHERE MADE:</entry>
<entry align="left">Melbourne</entry>
</row>
<row>
<entry align="center"> </entry>
<entry align="center"> </entry>
</row>
</tbody>
</tgroup>
</table>
</p>
<repro-tx/>
<repro-tx pointsize="10">
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>DISTRICT REGISTRAR</rx.text>
</rx.p>
<rx.p emphasis="none" justify="full" line-spacing="single" point-size="10">
<rx.text>Date Entered:</rx.text>
</rx.p>
</repro-tx>
 
Old November 17th, 2016, 07:56 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your XSLT is incomplete, so I can't help you debug it.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 17th, 2016, 08:01 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

But I would suggest that if you really think that changing a "." to a hyphen in the element name fixes the problem, that strongly suggests a bug in your XSLT processor, so the next thing to do is to try it with a different XSLT processor to confirm your suspicion.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 17th, 2016, 08:31 AM
Authorized User
 
Join Date: Nov 2016
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Quote:
Originally Posted by mhkay View Post
But I would suggest that if you really think that changing a "." to a hyphen in the element name fixes the problem, that strongly suggests a bug in your XSLT processor, so the next thing to do is to try it with a different XSLT processor to confirm your suspicion.
Thanks mhkay. Now i am using saxon9.jar for converting using batch process. Can you please suggest which one is latest and exact one.

Thanks, bharathi
 
Old November 17th, 2016, 08:33 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The current release of Saxon is 9.7.0.11
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Element 'ListItem' is not known element .... in my DropDownList SunsetFlorida BOOK: Beginning ASP.NET 4.5 : in C# and VB 1 December 29th, 2015 02:12 AM
Identify element based on the element data/content ROCXY XSLT 7 September 8th, 2011 02:48 AM
How to MOVE sub-element to preceding-sibling’s last sub-element lkd XSLT 6 March 15th, 2011 11:15 AM
Chapter 9: Element[user control] is not a known element Arya BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 December 20th, 2009 07:31 AM
Problem adding element to the previous element dani1 XSLT 5 September 10th, 2008 01:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.