Subject: RE: [xsl] a namespace problem From: "Bryan Rasmussen" <bry@xxxxxxxxxx> Date: Mon, 8 Apr 2002 18:01:11 +0200 |
>I'm not sure what your tool was doing, but I think it's highly >inadvisable to treat prefixes as anything but a >string-that-happens-to-currently-be-associated-with-a-namespace. >Namespace-aware tools such as XSLT, DOM, SAX, XML Schema, RELAX NG, >etc etc will not make any distinction between foo:bar and goo:bar as >long as foo and goo are associated with the same namespace URI in the >same document. For example, given that both prefixes are declared >within a document, when XSLT creates a copy of a document, the >processor is quite within its rights to choose either prefix for a >particular element. When you use the name() function, it could return >either 'foo:bar' or 'goo:bar' - it doesn't matter which you used in >the document. If you need to distinguish between a foo:bar element and >a goo:bar element, then foo and goo should be associated with >different namespaces. no argument there if I'm the xml designer, but in this case I was of course the xml consumer, also there is one case in which it struck as being useful to be able to switch prefixes, that being I have an xslt that writes out an? xslt, so an xsl with the xsl prefix writes out an xsl with the tempsl prefix, or vice-versa. However at one point we hired a new xslt guy and, despite his having done this for a year and a half and being a datalog, I guess that's going for a masters in computer science, he didn't really know that there was such a thing as namespaces or that you could write xslt with xslt and so on and so forth(it was pretty trying) anyhow as I was fiddling around writing my prefix-switcher I thought about how much easier it would have been for him if he could have used it to switch the before and afters to figure out what was going on. I solved my rss: problem with your suggestion of course, but it still does seem like one of the most counter-intuitive things about xml I can think of. Funny enough I came across Joe English's complaints about namespaces on xml-dev http://lists.xml.org/archives/xml-dev/200204/msg00170.html which reminded me of this. The question being that since my xslt used two different prefix's for the rss namespace, did this make the xslt a borderline document? Cheers Bryan XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] a namespace problem, Jeni Tennison | Thread | Re: [xsl] a namespace problem, Jeni Tennison |
[xsl] grouping data of an xml file, 林 子芯 | Date | Re: [xsl] Another beginner question, Greg Faron |
Month |