OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   attribute name/namespace question

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: attribute name/namespace question
  • From: Christof <csad7@t-online.de>
  • Date: Sat, 26 Mar 2005 15:12:48 +0100
  • User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

hello,
element and attribute names may include a colon character in their name
as far as I understand the XML specification.
therefore something like the following should be possible:

	<x xmlns:prefix="exampleuri"
		 prefix:attname="default-value"
		 prefix:prefix:attname="ref-to-new-value"/>

the attribute with the local-name "prefix:attname" is in the
"exampleuri" namespace which uses "prefix" as its prefix-identifier.
the attribute with the local-name "attname" is also in the "prefix"
namespace.

might look a bit contrived and useless but we are thinking of using such
a thing for a templating system which uses ideas of the kid (python)
templating framework. the above example would use the attribute
"prefix:attname" as a default. the processing would replace this
attribute with the one defined by "prefix:prefix:attname".

the above example is actually parsable with XOM and DOM4J under Java
1.4.2 but does produce erroes on other machines with other JDKs . My
guess is an older XML parser in other JDKs but I wanted to be sure that
my general understanding is right.

thanks a lot
chris




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS