Xerces c++ getNodeType() Problem..

Discussion in 'XML' started by christian.eickhoff@nt.uni-saarland.de, Nov 8, 2006.

  1. -saarland.de

    -saarland.de Guest

    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
     
    -saarland.de, Nov 8, 2006
    #1
    1. Advertising

  2. 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
     
    Joe Kesselman, Nov 8, 2006
    #2
    1. Advertising

  3. -saarland.de

    spiff Guest

    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


    -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
     
    spiff, Nov 8, 2006
    #3
  4. -saarland.de

    -saarland.de Guest

    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
     
    -saarland.de, Nov 9, 2006
    #4
  5. -saarland.de

    spiff Guest

    Christian,

    you are welcome.

    cheers
    spiff


    -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
     
    spiff, Nov 9, 2006
    #5
  6. >> 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
     
    Joe Kesselman, Nov 9, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roy Benjamin
    Replies:
    3
    Views:
    538
    Mike Schilling
    Jul 23, 2003
  2. Grzegorz Wrazen

    Xerces problem with jar file

    Grzegorz Wrazen, Aug 30, 2004, in forum: Java
    Replies:
    1
    Views:
    341
    Aria Kokoschka
    Sep 1, 2004
  3. Soeren
    Replies:
    2
    Views:
    362
    Waxolunist
    Sep 22, 2004
  4. Mark F
    Replies:
    0
    Views:
    456
    Mark F
    Mar 7, 2005
  5. cvissy
    Replies:
    0
    Views:
    615
    cvissy
    Nov 16, 2004
Loading...

Share This Page