You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "David R." <da...@hotmail.com> on 2002/05/14 10:04:43 UTC
DOM_Node::getPrefix() always returns NULL
In the following example, I am parsing the XML file and trying to get the
prefix of the node <my:person>David</my:person>.
The call to DOM_Node::getPrefix() always returns NULL, while I understand
that it should return "my". However, the call to DOM_Node::getNamespaceURI()
does return the correct value "http://david.com/david-schema".
Some guidance on how to get the prefix would be appreciated.
Best regards,
David Ruana
--------------- File david3.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://david.com/david-schema"
targetNamespace="http://david.com/david-schema">
<xs:element name="addressbook">
<xs:complexType>
<xs:sequence>
<xs:element ref="my:person" minOccurs='1' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="person" type="xs:string"/>
</xs:schema>
--------------- File david3.xml
<?xml version="1.0" encoding="UTF-8"?>
<my:addressbook xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:my="http://david.com/david-schema"
xsi:schemaLocation="http://david.com/david-schema david3.xsd">
<my:person>David</my:person>
</my:addressbook>
_________________________________________________________________
Descargue GRATUITAMENTE MSN Explorer en
http://explorer.yupimsn.com/intl.asp.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
Re: DOM_Node::getPrefix() always returns NULL
Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
I seem to remember a bug being reported not so long ago where
prefix's were being stripped out when validated. What version of xerces are
you using? Have you tried the nightly build? Please feel free to post the
code snippet so we can take a look.
Gareth
On Tue, 14 May 2002, David R. wrote:
> In the following example, I am parsing the XML file and trying to get the
> prefix of the node <my:person>David</my:person>.
>
> The call to DOM_Node::getPrefix() always returns NULL, while I understand
> that it should return "my". However, the call to DOM_Node::getNamespaceURI()
> does return the correct value "http://david.com/david-schema".
>
> Some guidance on how to get the prefix would be appreciated.
>
> Best regards,
> David Ruana
>
> --------------- File david3.xsd
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:my="http://david.com/david-schema"
> targetNamespace="http://david.com/david-schema">
>
> <xs:element name="addressbook">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="my:person" minOccurs='1' maxOccurs='unbounded'/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> <xs:element name="person" type="xs:string"/>
>
> </xs:schema>
>
> --------------- File david3.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <my:addressbook xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:my="http://david.com/david-schema"
> xsi:schemaLocation="http://david.com/david-schema david3.xsd">
>
> <my:person>David</my:person>
> </my:addressbook>
>
>
>
> _________________________________________________________________
> Descargue GRATUITAMENTE MSN Explorer en
> http://explorer.yupimsn.com/intl.asp.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>
--
Gareth Reakes, Head of Product Development
DecisionSoft Ltd. http://www.decisionsoft.com
Office: +44 (0) 1865 203192
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org