Package com.openinventor.ldm.xml
Class SbXmlTag
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.ldm.xml.SbXmlTag
-
public class SbXmlTag extends Inventor
XML tag from LDM filer. This class allows the application to read back a custom XML section that was inserted in a LDM file header using the method SoLDMConverter.setXmlCallback().Let's suppose the following XML text appears in the LDM file header:
The following code will produce the output below:... <MY_CUSTOM_TAG_SECTION> text <CUSTOM_TAG1>value1</CUSTOM_TAG1> <CUSTOM_TAG2>value2</CUSTOM_TAG2> </MY_CUSTOM_TAG_SECTION> ... SoVolumeData volData = new SoVolumeData(); // Volume from LDM file . . . SoVRLdmFileReader reader = (SoVRLdmFileReader)volData.getReader(); SbXmlTag mySectionTag = reader.getXmlTag("MY_CUSTOM_TAG_SECTION"); if (mySectionTag.exist()) { String sectionName = mySectionTag.getName(); String sectionText = mySectionTag.getText(); for (SbXmlTag t = mySectionTag.getFirstChildTag(); t.exist(); t = t.getNextSiblingTag()) { String tagName = t.getName(); String tagText = t.getText(); } } Output:
MY_CUSTOM_TAG_SECTION:text CUSTOM_TAG1:value1 CUSTOM_TAG2:value2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exist()
Indicates if this XML tag is valid.SbXmlTag
getFirstChildTag()
Returns the first XML child tag.java.lang.String
getName()
Returns the name of the XML tag.SbXmlTag
getNextSiblingTag()
Returns the next sibling XML child.java.lang.String
getText()
Returns the text associated with the XML tag.void
setValue(SbXmlTag copyFrom)
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
getText
public java.lang.String getText()
Returns the text associated with the XML tag.
-
setValue
public void setValue(SbXmlTag copyFrom)
-
getName
public java.lang.String getName()
Returns the name of the XML tag.
-
getNextSiblingTag
public SbXmlTag getNextSiblingTag()
Returns the next sibling XML child.
-
getFirstChildTag
public SbXmlTag getFirstChildTag()
Returns the first XML child tag.
-
exist
public boolean exist()
Indicates if this XML tag is valid.
-
-