Re: [saxon] Use of QName forcing declaration "Unused" namespaces
| Newsgroups | gmane.text.xml.xsl.general.mulberrytech,gmane.text.xml.saxon.help |
|---|---|
| Message-ID | <[email protected]> |
Ihe Onwuka <[email protected]> writes: > However if I remove any one of the namespaces I get this error. > > Error at char 79 in expression in xsl:sequence/@select on line 14 column > 118 of ***.xsl: > FONS0004 Namespace prefix {jx} has not been declared > at function local:localizedName on line 12 of ***.xsl: I believe you’re bumping up against a limitation in the xs:QName constructor. See: https://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-31/html/Overview.html#constructor-qname-notation > Here is the function local:localizedName which is designed to return a > local name from a QName or a string. > > <xsl:function name="local:localizedName" as="xs:string?"> > <xsl:param name="name"/> > <xsl:sequence select="local-name-from-QName(if ($name instance of > xs:QName) then $name else xs:QName($name))"/> > </xsl:function> Using fn:QName() instead of xs:QName() here will avoid the problem, I believe. You’ll have to use *-from-QName() functions to get the URI and local name (and prefix, if you care). Be seeing you, norm -- Norman Tovey-Walsh <[email protected]> https://nwalsh.com/ > I often marvel that while each man loves himself more than anyone else, > he sets less value on his own estimate than on the opinions of > others.--Marcus Aurelius --~---------------------------------------------------------------- XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386 or by email: [email protected] --~--
signature.asc
(application/pgp-signature, 832 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1ury//rzuvqf7fN/hVWfHhJMAHkFAl8W9yIACgkQhVWfHhJM AHn1qRAAxX07wns0C91GhgbXr7x0v2rV5hfBskjkvWU98bNtUDwSWbla6qH0LT/o mtA6HTRFjJrNZWUOfB8yg2jDhhi/FZCl+MLh/5OHUC1l3hzxVvyWyq+4gdvipF3Q nz9+J87k+NgmPSwlOqMCj8ficukb+1l09T1bQb8TevZFaXIwVEv/ORRhlN7UNwF6 jHSbl38jn1oXyDm0wrqRq1O42LSZXLvmq3lH7vbomqdEnadyVSM4a3AO8P9R+Y46 BaKDF2Dxcg031aGsbqibVIwQy1AVoU2bfdur92RtmwMt8w6VBBix8Qb3bYTVM2ml 2NZqZIZeUrZFqlJ4b25SkDOaHE9H4jGUwG18/UrCrwow99P3YfB1AyDtLubnV4rm E3vIktaRsGRzZPto2py+7kLNJTBqW8CtCWL+fxtmWUmJQ6skiOusHas2/JGMlweF p/a56b3kddCWGqwrPwXopyEILOLfxL6i0nmLUxtzprq2MgyCdrAtuX30bWWpalbh MgQXjCtjeBpwyrFU1oc+/TlU3fFF4d9rE4B+ydDXnRasUm2wiixstTI9tHqdKZNO WQ2sHH446hddJAvgNp9myr8Tupl3G9qFMpR7DcUY4XoyFYT3vMzhbriZtvUsVZ1T ZPsZOubKTpDefZOe1l8kxsGHRVFpUamIAnGYhktUFBYBsEEj/rc= =tYzk -----END PGP SIGNATURE-----