Jump to content

No attributte support in UT_XML classes?


Guest mantragora

Recommended Posts

Guest mantragora

Or maybe I'm missing something?

Can I extract "identyficator" or "type" somehow from this code?

 

<?xml version="1.0" encoding="utf-8" ?>
<Nodes>
  <SOP>
    <Node identyficator="0">
        <Defaults>
	    <Name type="internal">hdk_sop_foo</Name>
	    <Name type ="external">SOP Foo</Name>		
            <Name type="iconname">SOP_Foo</Name>
            <Name type="iconextension">svg</Name>
	    <Name type="version">1.0</Name>
        </Defaults>
		
        <Parameters>
            <Parm identyficator="0">
                 <Name type="internal"></Name>
                 <Name type="external"></Name>
            </Parm>
            <Parm identyficator="1">
                 <Name type="internal"></Name>
                 <Name type="external"></Name>
            </Parm>
        </Parameters>
    </Node>  
  </SOP> 

  <DOP>
  </DOP> 	
</Nodes>
There are only four methods available in UT_XMLNode, and it doesn't look that any of it gives access to attributes.

And what is getContents() method returning?

/// Return the contents of the node.

/// Return an empty string if this is not a contents node.

WTF is this? I always get blank string with it, so what should be specified in the node to get some data with it?

Thanks!

Edited by mantragora
Link to comment
Share on other sites

Guest mantragora

I moved my project to PUGIXML, which works more like .NET XML implementation. But still I would like to see some examples, if there is attribute support in UT_XML* classes.

Edited by mantragora
Link to comment
Share on other sites

Guest mantragora

It looks that there is more than one XML parser in HDK. One is UT_XMLDomParser and the second is UT_XMLSaxParser. The second one does have attribute support, but all the methods that touches attruibutes are protected, so I can't access them. Any tips?

Link to comment
Share on other sites

Guest mantragora

Hmm..., maybe I should just use UT_XMLReader class instead of those two Parser classes? What's the difference between those classes? Why do we have 3 possibilities on how to parse the file?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...