All my declared namespaces are showing up in my <br/>
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 71
- Joined: Fri Apr 30, 2004 8:00 pm
- Location: Texas
All my declared namespaces are showing up in my <br/>
I'm using Saxon 8.1B and Oxygen v5 (I'll be upgrading this evening to v7)
When I translate a namespace aware XML file using my stylesheet, I get all the namespaces repeated in the <BR/> html tags. They also show up in other tags (like <p>)
Here's my XSL fragment so far..
Here's my output
Why would the namespaces be repeated within the <BR/> tag?
-: confused :-
When I translate a namespace aware XML file using my stylesheet, I get all the namespaces repeated in the <BR/> html tags. They also show up in other tags (like <p>)
Here's my XSL fragment so far..
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"
xpath-default-namespace="urn:schemas-microsoft-com:office:spreadsheet">
<!--
****************************************************
-->
<!-- Begin Output Processing -->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/Workbook">
<xsl:apply-templates select="Worksheet"></xsl:apply-templates>
</xsl:template>
<!--
****************************************************
Template for element Worksheet
****************************************************
-->
<xsl:template match="Worksheet">
<br/><xsl:text> In the Template for Worksheet processing</xsl:text>
<xsl:apply-templates select="Table/Row"></xsl:apply-templates>
</xsl:template>
... more templates down here ...
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"/> In the Template for Worksheet processing[In the Template for Row processing][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: ][Data Value: Chapter 1][Cell Index Value: 5][Data Value: Y][Cell Index Value: ][Data Value: Describe this Chapter][In the Template for Row processing][Cell Index Value: 2][Data Value: Req 1][Cell Index Value: 5][Data Value: Y][Cell Index Value: ][Data Value: Describe Req 1 here][In the Template for Row processing][Cell Index Value: 2][Data Value: Req 2][Cell Index Value: 5][Data Value: Y][Cell Index Value: ][Data Value: Describe Req 2 here][In the Template for Row processing][Cell Index Value: 3][Data Value: Req 2.1][Cell Index Value: 5][Data Value: Y][Cell Index Value: ][Data Value: Describe Req 2.1 here][In the Template for Row processing][Cell Index Value: 2][Data Value: Req 3][Cell Index Value: 5][Data Value: Y][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 3][Data Value: Req 3.1][Cell Index Value: 5][Data Value: Y][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 3][Data Value: Req 3.2][Cell Index Value: 5][Data Value: N][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 3][Data Value: Req 3.3][Cell Index Value: 5][Data Value: N][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 4][Data Value: Req 3.3.1][Cell Index Value: ][Data Value: Y][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 4][Data Value: Req 3.3.2][Cell Index Value: ][Data Value: N][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 3][Data Value: Req 3.4][Cell Index Value: 5][Data Value: Y][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 4][Data Value: Req 3.4.1][Cell Index Value: ][Data Value: Y][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 2][Data Value: Req 4][Cell Index Value: 5][Data Value: Y][Cell Index Value: 6][In the Template for Row processing][Cell Index Value: 2][Data Value: Req 5][Cell Index Value: 5][Data Value: Y][Cell Index Value: 6]<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"/> In the Template for Worksheet processing[In the Template for Row processing][Cell Index Value: 1]<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet"/> In the Template for Worksheet processing[In the Template for Row processing][Cell Index Value: 1]
-: confused :-
--------------------------
- mike
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
- mike
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
-
- Posts: 71
- Joined: Fri Apr 30, 2004 8:00 pm
- Location: Texas
I still have thir propblem after upgrading to v.7. I guess I was hoping a newer version of Saxon would fix the problem.
Since it didn't, and I can't believe this is a widespread problem, I must assume I've done something wrong in my XSLT file.
If anyone has any thought, PLEASE let me know.
Thanks,
Since it didn't, and I can't believe this is a widespread problem, I must assume I've done something wrong in my XSLT file.
If anyone has any thought, PLEASE let me know.
Thanks,
--------------------------
- mike
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
- mike
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: All my declared namespaces are showing up in my <br/&
Post by sorin_ristache »
Because you did not specify what namespaces you don't want in the output, by adding the attributemphare wrote:Why would the namespaces be repeated within the <BR/> tag?
Code: Select all
exclude-result-prefixes="xsi x x2 ss o html c"
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
Regards,
Sorin
It is an FAQ. The exclude-result-prefixes attribute is required to be implemented by any XSLT 1.0 processor, so early versions of Saxon 6.5 and Saxon 8 implement it correctly.mphare wrote:I still have thir propblem after upgrading to v.7. I guess I was hoping a newer version of Saxon would fix the problem.
Regards,
Sorin
-
- Posts: 71
- Joined: Fri Apr 30, 2004 8:00 pm
- Location: Texas
I've tried to pair this down as far as I can.
I'm using Oxy7 with Saxon 8B
Here's the original XML document:
Here's the XSLT:
And here's the output:
Notice the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" inserted in the <br/> tags as <brxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
What's up with that?
I'm using Oxy7 with Saxon 8B
Here's the original XML document:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?><?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Cell>Inside the Cell 1</Cell>
<Cell>Inside the Cell 2</Cell>
</Workbook>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
****************************************************
-->
<!-- Begin Output Processing -->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/Workbook">
<xsl:text>Found Workbook</xsl:text>
<xsl:apply-templates select="Cell"></xsl:apply-templates>
</xsl:template>
<!--
****************************************************
Template for Cell
****************************************************
-->
<xsl:template match="Cell">
<br/><xsl:text>Inside the Cell</xsl:text>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>Found Workbook<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>Inside the Cell<br xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>Inside the Cell
What's up with that?
--------------------------
- mike
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
- mike
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service