public class SbXmlTag extends Inventor
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
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and 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) |
dispose, getNativeResourceHandle
public java.lang.String getText()
public void setValue(SbXmlTag copyFrom)
public java.lang.String getName()
public SbXmlTag getNextSiblingTag()
public SbXmlTag getFirstChildTag()
public boolean exist()
Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com