Re: [R] read XML

From: Martin Morgan <mtmorgan_at_fhcrc.org>
Date: Wed, 30 Jul 2008 05:48:33 -0700

"Paulo Cardoso" <pecardoso_at_netcabo.pt> writes:

> I have a xml exported by Manifold GIS but I'm not being able to import it
> into R using XLM package.

I can

> library(XML)
> xml <- xmlTreeParse("tmp.xml", useInternal=TRUE)
> xpathApply(xml, "//component/@ymin", xmlValue)
[[1]]
[1] "0.32371064328183174"

[[2]]
[1] "0.32371064328183174"

[[3]]
[1] "0.84662172667648694"

so I wonder what specifically your difficulty is?

Best,

Martin

>
>
>
> The file have this structure:
>
>
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
> - <layout>
>
> <name>Layout 2</name>
>
> <pagesByX>1</pagesByX>
>
> <pagesByY>1</pagesByY>
>
> - <elements>
>
> <legend refParent="r3" xmax="0.54156171284634758"
> xmin="0.020151133501259435" ymax="0.31480598161051165"
> ymin="0.042461931948864044" />
>
> <component background="auto" border="none" borderDegMinSec="false"
> borderEachPage="true" borderFont="Tahoma, 8" borderFore="#000000"
> borderMargin="12" borderNoOverlaps="true" borderRounding="0" borderStep="1"
> borderUnit="Meter" controlPoints="auto" graticule="auto" grid="auto"
> legend="auto" name="MapMnaziBayhab" northArrow="auto" paging="continuous"
> ref="r1" scaleBar="auto" scope="locked center / scale"
> scopeDetail="646802.61034615175,8856311.5759953968,150"
> xmax="0.35877862595419846" xmin="0.027989821882951665"
> ymax="0.98902384414662947" ymin="0.32371064328183174" />
>
> <component background="auto" border="none" borderDegMinSec="false"
> borderEachPage="true" borderFont="Tahoma, 8" borderFore="#000000"
> borderMargin="12" borderNoOverlaps="true" borderRounding="0" borderStep="1"
> borderUnit="Meter" controlPoints="auto" graticule="auto" grid="auto"
> legend="hide" name="MapMnaziBayall" northArrow="auto" paging="continuous"
> ref="r3" scaleBar="auto" scope="locked center / scale"
> scopeDetail="646802.61034615175,8856311.5759953968,150"
> xmax="0.707379134860051" xmin="0.37659033078880411"
> ymax="0.98902384414662947" ymin="0.32371064328183174" />
>
> <component background="auto" border="none" borderDegMinSec="false"
> borderEachPage="true" borderFont="Tahoma, 8" borderFore="#000000"
> borderMargin="12" borderNoOverlaps="true" borderRounding="0" borderStep="1"
> borderUnit="Degree" controlPoints="auto" graticule="auto" grid="auto"
> legend="auto" name="Map Africa Mnazi" northArrow="auto" paging="continuous"
> ref="r6" scaleBar="auto" scope="entire component" xmax="0.93198992443324935"
> xmin="0.73047858942065491" ymax="0.98902384414662947"
> ymin="0.84662172667648694" />
>
> </elements>
>
> </layout>
>
>
>
> Any idea?
>
>
>
> Thanks.
>
>
>
> Paulo Cardoso
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M2 B169
Phone: (206) 667-2793

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 30 Jul 2008 - 13:09:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Jul 2008 - 14:32:59 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive