Hi,

Consider the following code:

          require(XML)
          xmlFile = paste( "<?xml version=\"1.0\"
encoding=\"ISO-8859-1\"?>\n", 
                    "<mzXML xmlns=\"a\" xmlns:xsi=\"b\"
xsi:schemaLocation=\"c\">\n",
                    "<parentFile a=\"a\" b=\"b\" />\n",
                    "</mzXML>\n")
          cat(xmlFile)
          
          a = function(x,...){
            cat("Attributes of ", xmlName(x), ": "); 
            print(xmlAttrs(x));
            cat("\n"); 
            NULL
          }
          
          xmlTreeParse(file=xmlFile, asText=TRUE,
handlers=list("startElement"=a) )

And its output:

         <?xml version="1.0" encoding="ISO-8859-1"?>
         <mzXML xmlns="a" xmlns:xsi="b" xsi:schemaLocation="c">
         <parentFile a="a" b="b" />
         </mzXML>

        Attributes of  parentFile :   a   b 
                                             "a" "b" 

        Attributes of  mzXML : schemaLocation 
                                          "c" 
It seems to me that XML parser was able to correctly list all the attributes
of the "parentFile" node but it failed on "mzXML" node.
Am I missusing the functions somehow or is it a bug?
Attribute names in "mzXML" node are part of mzXML file format and can not be
changed (removing all ':' would fix the problem) and I would like to store
than so whan I write mzXML file I have the same header.

Jarek
====================================================\=======

 Jarek Tuszynski, PhD.                           o / \ 
 Science Applications International Corporation  <\__,|  
 (703) 676-4192                                   ">   \
 [EMAIL PROTECTED]                     `    \



        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to