Unwanted namespace declarations in sqf/xsl output
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 56
- Joined: Fri Jun 06, 2008 8:05 pm
Unwanted namespace declarations in sqf/xsl output
Hi all,
I've just been experimenting using Schematron Quick Fixes on my TEI documents. My goal is to catch cases like this:
And offer to (1) wrap "S" in a TEI <term> element and (2) to generate a unique ID for this new element and insert an @xml:id attribute on the <term> element, with the following result:
I couldn't figure out a single-pass fix using pure SQF for this, so I resorted to XSL:
Unfortunately, the result of this for some reason adds an xmlns:xml namespace declaration to the result:
When I split this SQF into two fixes, though, and add the attribute as a second fix, the xmlns:xml declaration is not there:
Is there a better way that allows me to (1) perform the fix in a single step and (2) prevent the unwanted xmlns namespace declaration?
I've just been experimenting using Schematron Quick Fixes on my TEI documents. My goal is to catch cases like this:
Code: Select all
<item><hi rend="strong">S,</hi> Office of the Secretary</item>
Code: Select all
<item><hi rend="strong"><term xml:id="t_S_1">S</term>,</hi> Office of the Secretary</item>
Code: Select all
<let name="term" value="if (ends-with(.//tei:hi[1], ',')) then replace(.//tei:hi[1], ',$', '') else .//tei:hi[1]"/>
<let name="id" value="concat('t_', replace($term, '\W', ''), '_1')"/>
<sqf:fix id="add-term-and-xml-id">
<sqf:description>
<sqf:title>Add a missing term element</sqf:title>
</sqf:description>
<sqf:replace match="tei:hi[1]">
<xsl:element name="tei:hi">
<xsl:attribute name="rend" select="./@rend"/>
<xsl:element name="tei:term">
<xsl:attribute name="xml:id" select="$id"/>
<xsl:value-of select="$term"/>
</xsl:element>
<xsl:text>,</xsl:text>
</xsl:element>
</sqf:replace>
</sqf:fix>
Code: Select all
<item><hi rend="strong"><term xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:id="t_S_1">S</term>,</hi> Office of the Secretary</item>
Code: Select all
<sqf:fix id="add-xml-id">
<sqf:description>
<sqf:title>Add a missing @xml:id</sqf:title>
</sqf:description>
<sqf:add match=".//tei:term" target="xml:id" node-type="attribute" select="$id"/>
</sqf:fix>
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Unwanted namespace declarations in sqf/xsl output
Hello,
Unfortunately I didn't found a solution for this problem.
It seems that the serializer that we use in oXygen when we create the fragment to be inserted, generates also the XML namespace declaration. I added an issue on our issue tracker. We will notify you when it will be fixed.
Best Regards,
Octavian
Unfortunately I didn't found a solution for this problem.
It seems that the serializer that we use in oXygen when we create the fragment to be inserted, generates also the XML namespace declaration. I added an issue on our issue tracker. We will notify you when it will be fixed.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Unwanted namespace declarations in sqf/xsl output
Hello,
We released Oxygen XML Editor 19.1 a couple of days ago and the problem you reported should be fixed.
Best Regards,
Octavian
We released Oxygen XML Editor 19.1 a couple of days ago and the problem you reported should be fixed.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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