Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Namespace Attributes [Thread Next] Re: Namespace AttributesTo: NULL Date: 12/4/2007 9:07:00 AM geoff wrote:
> The snippet below had 'po' in front of 'billTo', 'shipTo', 'order', etc. but
> they say by moving the 'po' namespace definition to the 'po:po' element, the
> child elements fall into that namespace:
If so, they're wrong. However, you could get that effect by using the
Default Namespace Declaration:
<po id="43871" submitted="2001-10-05"
xmlns="http://www.skatestown.com/ns/po">
<billTo id="addr-1">
...
</billTo>
<shipTo href="addr-1"/>
<order>
...
</order>
</po>
Note that the Default Namespace Declaration only affects elements. If
you want attributes to be in a namespace, they have to use a properly
declared prefix. (However, it is not uncommon for namespaced nodes to
expect non-namespaced attributes, so always check your particular schema
or application spec to see whether this is going to be an issue.)
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
