Title: What should be an easy xmlbeans question
it still prints it out to my debug.  I tried the XmlString.Factory.parse and passed my string it.  It separated everyhting, but i shouldn't have to go through the trouble to get the information out.  Any other ideas?


From: Raj Alagumalai [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 20, 2005 3:21 PM
To: dev@xmlbeans.apache.org
Subject: RE: What should be an easy xmlbeans question

Jason,
 
Can you try xmlText() instead of toString()
 
Cheers
Raj
 


From: Green, Jason M. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 20, 2005 12:14 PM
To: [EMAIL PROTECTED]
Subject: What should be an easy xmlbeans question

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

Reply via email to