Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Xerces c++ getNodeType() Problem..

Reply
Thread Tools

Xerces c++ getNodeType() Problem..

 
 
christian.eickhoff@nt.uni-saarland.de
Guest
Posts: n/a
 
      11-08-2006
Hello Everybody,

am currently developing some coder for XML files but am facing some
minor problem which might be very easy to solve for XERCES experts. For
my coder it is indispensable to determine the type of the current Node
out of the XSD Schema file but when I use the function:
Node->getNodeType(), I always receive the value 1 even if I am dealing
with an ATTRIBUTE_NODE like this:

Schema file subsection:
<xsd:attribute name="type" type="mimeTopLevelType" use="required" />
(should be enum value 2 as far as I know..)

For test purposes I do this very simple output on the Node from up
above for example:
short childtype = myChild->getNodeType();
std::cout << "Element Type: " << childtype <<'\n';

Return value:
Element Type: 1

What am I doing wrong? Am really confused as the type determiniation
seems to be an easy task and as I get the correct values for
Node->getNodeName and Node->hasChildNodes.. Any hint or help is highly
appreciated!!

Thanks in advance
Christian

 
Reply With Quote
 
 
 
 
Joe Kesselman
Guest
Posts: n/a
 
      11-08-2006
I'm not sure from your description, but it sounds like you're trying to
use the DOM calls to examine an XML document which happens to be a
schema. That will give you information about the schema as a document,
NOT information about the documents that schema describes. Xerces does
have a separate API for examining schemas, if that's what you're looking
for.

Either that, or you're querying a different node than you think you are.
You didn't provide enough detail to tell us exactly what file you're
loading or how you're obtaining the "mychild" node.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
 
spiff
Guest
Posts: n/a
 
      11-08-2006
Hi Christian!

Just to say the obvious in the beginning: the node "xsd:attribute" is
of type Element.

If this is not the problem did you try to use DOMNamedNodeMap*
DOMNode::getAttributes ()?

regards
spiff


http://www.spycomponents.com
XML tools for XMLSpy


http://www.velocityreviews.com/forums/(E-Mail Removed)-saarland.de schrieb:

> Hello Everybody,
>
> am currently developing some coder for XML files but am facing some
> minor problem which might be very easy to solve for XERCES experts. For
> my coder it is indispensable to determine the type of the current Node
> out of the XSD Schema file but when I use the function:
> Node->getNodeType(), I always receive the value 1 even if I am dealing
> with an ATTRIBUTE_NODE like this:
>
> Schema file subsection:
> <xsd:attribute name="type" type="mimeTopLevelType" use="required" />
> (should be enum value 2 as far as I know..)
>
> For test purposes I do this very simple output on the Node from up
> above for example:
> short childtype = myChild->getNodeType();
> std::cout << "Element Type: " << childtype <<'\n';
>
> Return value:
> Element Type: 1
>
> What am I doing wrong? Am really confused as the type determiniation
> seems to be an easy task and as I get the correct values for
> Node->getNodeName and Node->hasChildNodes.. Any hint or help is highly
> appreciated!!
>
> Thanks in advance
> Christian


 
Reply With Quote
 
christian.eickhoff@nt.uni-saarland.de
Guest
Posts: n/a
 
      11-09-2006
So sorry everbody for bothering you with this stupid question..
Was just a personal misunderstanding in XML Schema Syntax as I thought
attributes have to be definied along with the element itself. I promise
that next time I wont post a question anymore after havenīt thought
about it hundred times..

Thanks to both of the previous writers for guiding me on the right
track..

Regards,
Christian

 
Reply With Quote
 
spiff
Guest
Posts: n/a
 
      11-09-2006
Christian,

you are welcome.

cheers
spiff


(E-Mail Removed)-saarland.de schrieb:

> So sorry everbody for bothering you with this stupid question..
> Was just a personal misunderstanding in XML Schema Syntax as I thought
> attributes have to be definied along with the element itself. I promise
> that next time I wont post a question anymore after havenīt thought
> about it hundred times..
>
> Thanks to both of the previous writers for guiding me on the right
> track..
>
> Regards,
> Christian


 
Reply With Quote
 
Joe Kesselman
Guest
Posts: n/a
 
      11-09-2006
>> So sorry everbody for bothering you with this stupid question..

That's OK. Sometimes the best way to figure out that you're asking the
wrong question is to try to explain the problem to someone else...

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
xerces in .jar.bz2 Alexandre Flament Java 0 08-14-2003 04:06 PM
Solution for MissingResourceException in apache standard taglib with xerces Leo Sauermann Java 0 07-28-2003 12:29 PM
Sun ONE, The xerces problem (Sun One Oh my) Roy Benjamin Java 3 07-23-2003 08:32 PM
[dom4j & Xerces] How to show validation errors? Stefan Siegl Java 2 07-17-2003 12:26 PM



Advertisments