[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    RE: What should be an easy xmlbeans question
From:       "Green, Jason M." <jason.green () ngc ! com>
Date:       2005-12-21 13:59:51
Message-ID: 709C48A578E65F4782607245CDD145AC03CC3D60 () xcgva501 ! northgrum ! com
[Download RAW message or body]

Thanks guys,
  I got the schema writers to correct this.  
Jason 

-----Original Message-----
From: Radu Preotiuc-Pietro [mailto:radup@bea.com] 
Sent: Tuesday, December 20, 2005 4:31 PM
To: dev@xmlbeans.apache.org
Subject: RE: What should be an easy xmlbeans question

As Dan correctly points out, for XmlBeans, that is an arbitrary piece of
XML which could contain attribues, other elements, mixed text etc.

The easiest (and fastest) way that I can think of right now to get the
string value is .newCursor().getTextValue()

Radu

-----Original Message-----
From: Green, Jason M. [mailto:jason.green@ngc.com]
Sent: Tuesday, December 20, 2005 12:45 PM
To: dev@xmlbeans.apache.org
Subject: RE: What should be an easy xmlbeans question


Thanks dan,
  I sent an email to the group that wrote the schema in hope that they
would add that in.  Is there an easy fix other than the parse function
if they won't change it? 

-----Original Message-----
From: Dan Durkin [mailto:ddurkin@scilearn.com] 
Sent: Tuesday, December 20, 2005 3:33 PM
To: dev@xmlbeans.apache.org
Subject: Re: What should be an easy xmlbeans question

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/conXMLBeansSupportBuiltInSch
emaTypes.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: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic