Subject: RE: [xsl] Optional namespace declaration in XML document From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 01 May 2006 11:02:55 -0400 |
Admittedly this may be inefficient or the document to be processed may be so complex that it may not be practical, but for simple situations it would be ok wouldn't it ?
The example docs were :-
<mydata xmlns="urn:myns"> <mydataitem>sample data</mydataitem> </mydata>
<mydata xmlns="urn:otherns"> <mydataitem>sample data</mydataitem> </mydata>
<mydata> <mydataitem>sample data</mydataitem> </mydata>
Wouldn't something like this do ?? :-
<xsl:template match="*[local-name(.) = 'mydata']"> ...
<xsl:template match="*[local-name(.) = 'mydataitem']"> ...
We use something similar on complex documents where only the top level element is declared as a global type and thus has a namespace affiliation, all other types are local (and the schema declares elementFormDefault='unqualified').
-- Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16 Also for XSLT/XSL-FO training: Minneapolis, MN 2006-07-31/08-04 Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25 Also for XSLT/XSL-FO training: Copenhagen,Denmark 2006-05-08/11 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Optional namespace declar, Fraser Goffin | Thread | RE: Re: [xsl] List of illegal chara, cknell |
RE: Re: [xsl] List of illegal chara, cknell | Date | RE: Re: Re: [xsl] List of illegal c, cknell |
Month |