[jdom-interest] element creation with < issues

Paul Libbrecht paul at activemath.org
Fri Jul 29 08:27:29 PDT 2005


Either you need to detach or you do not have a getParent!

I think DOM, probably the cross-platform lib you mean, has a getParent.

I think DOM doesn't make it easy to do this kind of copying but I may 
be wrong...

paul


Le 29 juil. 05, à 16:33, Narahari Lakshminarayana a écrit :

> Paul,
>
> That's exactly what I ended up doing.  But there should a way to be 
> able to do this easily.
>
> I don't understand this detaching concept.  Is it there in the regular 
> xml library as well ?
>
> When I mean regular it is the cross language api that JDOM helped us 
> avoid  ?
>
> I understand that XML to be well formed should have only one root.  
> But I don't understand
> What detach gives me.
>
> -Narahari
>
> -----Original Message-----
> From: Paul Libbrecht [mailto:paul at activemath.org]
> Sent: Friday, July 29, 2005 2:22 AM
> To: Narahari Lakshminarayana
> Subject: Re: [jdom-interest] element creation with < issues
>
> In order to parse, you need a surrounding element.
>
> Now, having this parsed into doc :
> doc.getRootElement().getChildren() gets you a list of the element.
> But you should probably detach each of them before adding them to 
> another parent, then add them to another document.
>
> paul
>
>
> Le 28 juil. 05, à 17:51, Narahari Lakshminarayana a écrit :
>
>> Hello folks:
>>  
>> May be this question has been asked before.  So please dont flame me.
>> I have done due diliegence by searching but could not find answers.
>>  
>> I have the following data that a method returns which is written by
>> another group.
>>  
>> I am trying to load this into a org.jdom.Document but  until and
>> unless I add a parent node like <a>.... </a> it is impossible to add
>> this to a document.  I understand the limitations here since an XML
>> has to have a root element and since I dont have one the Document is
>> not able to be created.
>>  
>> What is my alternative though to return this as List of Elements so I
>> can add this to another Document /
>>  
>> -Narahari
>>  
>>
>> <hourdata hour="140000" curtemp="88" dewpointtemp="72" windspeed="4"
>> winddir="290" weather_conditions="" relative_humidity="60"
>> apparent_temp="94"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <hourdata hour="150000" curtemp="88" dewpointtemp="72" windspeed="4"
>> winddir="290" weather_conditions="" relative_humidity="60"
>> apparent_temp="94"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <hourdata hour="160000" curtemp="88" dewpointtemp="72" windspeed="4"
>> winddir="290" weather_conditions="" relative_humidity="60"
>> apparent_temp="94"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <hourdata hour="170000" curtemp="88" dewpointtemp="71" windspeed="6"
>> winddir="290" weather_conditions="" relative_humidity="58"
>> apparent_temp="94"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <hourdata hour="180000" curtemp="88" dewpointtemp="71" windspeed="6"
>> winddir="290" weather_conditions="" relative_humidity="58"
>> apparent_temp="94"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <hourdata hour="190000" curtemp="88" dewpointtemp="71" windspeed="6"
>> winddir="290" weather_conditions="" relative_humidity="58"
>> apparent_temp="94"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <hourdata hour="200000" curtemp="82" dewpointtemp="72" windspeed="4"
>> winddir="290" weather_conditions="" relative_humidity="71"
>> apparent_temp="87"
>> icon_link="http://www.nws.noaa.gov/weather/images/fcicons/tsra.jpg" />
>>
>> <CITY>Marietta</CITY>
>> <COUNTY>Cobb</COUNTY>
>> <LATITUDE>33.930563</LATITUDE>
>> <LONGITUDE>-84.462218</LONGITUDE>
>> <NEXRAD_LONG_RANGE>KFFC</NEXRAD_LONG_RANGE>
>> <NEXRAD_SHORT_RANGE>KFFC</NEXRAD_SHORT_RANGE>
>> <STATE>GA</STATE>
>> <STATE_NAME>Georgia</STATE_NAME>
>> <WEATHER_STATION_ID>KMGE</WEATHER_STATION_ID>
>> <WEATHER_STATION_NAME>Marietta / Dobbins Air Force
>> Base</WEATHER_STATION_NAME> <ZIP>30067</ZIP>
>>
>>  _______________________________________________
>> To control your jdom-interest membership:
>> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.co
>> m
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>




More information about the jdom-interest mailing list