Jason,
From your schema:
<xs:element name="taskSetId">
</xs:element>
if you want taskSetId to resolve to a string you should assign a type to
the element that gets resolved to a string.
see
http://xmlbeans.apache.org/docs/2.0.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html
xs:string or xs:token etc should work.
HTH,
Dan
Green, Jason M. wrote:
Hey all,
I have limited experience w/ xmlbeans, but I have definitely not
encountered this problem before.
I compiled my schema and inluded my jar into my java project. I have
traversed through the xml file using the jar file with no problem until
I got to a certain value I wanted to print out.
Basically there was a field that I know is a string (or at least was in
the old version of the schema), but now when I do the get on it, it
returns an XmlObject type. I hadn't really run into that before, but I
added the .toString() on the end and did an System.out on it. What I
got was this:
<xml-fragment>12345</xml-fragment> . The value within is correct, but I
have no idea what the xml-fragment tags are and how to get rid of them.
Any ideas?
Here is the section in the xml, the section in the schema, and a chunk
of my code. Thanks
<conditionSet>
<condition>
<conditionName>All Systems Green</conditionName>
<defaultCondition>true</defaultCondition>
<taskSet>
<taskSetId>12345</taskSetId>
</taskSet>
</condition>
</conditionSet>
<xs:element name="defaultCondition" type="xs:boolean">
</xs:element>
<xs:element name="taskSet">
<xs:complexType>
<xs:sequence>
<xs:element name="taskSetId">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element >
while(conIter.hasNext())
{
condition =
(ElementTaskingDocument.ElementTasking.ConditionSet.Condition)
conIter.next();
if(condition.getDefaultCondition())
{
System.out.println(condition.getTaskSet().getTaskSetId().toString());
}
}
Jason
--
Dan Durkin
(617) 718-6762
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]