Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


What is causing this XSLT NAMESPACE_ERR?

From: "Michael Good" <musicxml@-----.--->
To: xml-dev@-----.---.---
Date: 6/7/2007 11:51:00 PM
I have a MusicXML 2.0 document that has this fragment:

  <credit page="1">
    <credit-words default-x="1580" default-y="3799"
                         font-size="24" font-weight="bold" justify="center"
                         valign="top" xml:lang="fr">La Boh&egrave;me
</credit-words>
    <credit-words font-size="16" font-weight="normal">Act I&#x2014;In
Soffitta</credit-words>
  </credit>

The page attribute for the credit element is new to MusicXML 2.0. In
MusicXML, all credits were on page 1. So our XSLT 1.0 stylesheet that
transforms to MusicXML 1.1 removes the page attribute, along with any
credit elements that are not on page 1:

  <!-- Remove a credit that is not on page 1 -->
 <xsl:template
    match="credit[@page and (@page != '1')]"/>

  <!-- Remove the page attribute for page 1 credits -->
  <xsl:template
    match="credit/@page[. = '1']"/>

All works well until there is an xml:lang attribute in the
credit-words element, as in the above example. When this happens,
Xerces 2.9.0 gives us an error:

XSLT fatal error at line 1: org.w3c.dom.DOMException: NAMESPACE_ERR:
An attempt is made to create or change an object in a way which is
incorrect with regard to namespaces.

If I remove the rule to get rid of the page attribute, the error
message goes away. We don't use any namespace or default namespaces in
MusicXML except for some XLink constructs and the xml:lang attribute.

Our generic identity transformation for elements and attributes is:

  <xsl:template match="*|@*|comment()|processing-instruction()">
    <xsl:copy><xsl:apply-templates
        select="*|@*|comment()|processing-instruction()|text()"
    /></xsl:copy>
  </xsl:template>

Can anybody explain what might be going on here to cause the error?
How would removing a page attribute in a parent element relate to the
xml:lang attribute in the child element? Am I doing something wrong in
one of these rules that is doing something unintended?

Thanks for any assistance!

Best regards,

Michael Good
Recordare LLC
www.recordare.com


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent