XML parsing issue

Viewing 1 post (of 1 total)
  • Author
  • #1110

    hi Gurus,
    I am trying to parse such XML structure:

    <?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
    <Data xmlns=”data10.xsd” version=”1.1″>
    <cmData scope=”all” type=”all”>
    <log action=”created” appInfo=”XMLmanager” appVersion=”1.0″ dateTime=”2015-05-07″ user=”XXX”/>
    <managedObject class=”Node” operation=”update” version=”1.0″>
    <p name=”id”>Nd1</p>
    <list name=”unitList”>
    <p name=”primary”>IF1</p>
    <p name=”Code”>A101</p>
    <p name=”Name”>NQ</p>
    <p name=”unitNumber”>1</p>
    <p name=”primary”>IF1</p>
    <p name=”Code”>A101</p>
    <p name=”Name”>NX</p>
    <p name=”unitNumber”>2</p>
    <managedObject class=”line” operation=”update” version=”1.0″>
    <p name=”id”>Ln1</p>
    <p name=”delay”>82</p>
    <p name=”loss”>-30</p>
    <p name=”ul”>0</p>

    And want to make such data frame:
    managedObject Operation name Value
    Node update id Nd1
    line update id Ln1
    line update delay 82
    line update loss -30
    line update ul 0

    could you please hint here, as I have an issue with xmlParse function:
    > doc <- xmlParse(file)
    xmlns: URI raml21.xsd is not absolute
    > class(doc)
    [1] “XMLInternalDocument” “XMLAbstractDocument”
    > root = xmlRoot(doc)
    > class(root)
    [1] “XMLInternalElementNode” “XMLInternalNode” “XMLAbstractNode”
    > child = xmlChildren(root)
    > class(child)
    [1] “XMLInternalNodeList” “XMLNodeList”
    > child_next = xmlChildren(child)
    Error in UseMethod(“xmlChildren”) :
    no applicable method for ‘xmlChildren’ applied to an object of class “c(‘XMLInternalNodeList’, ‘XMLNodeList’)”

    could you please help understand why I can`t fetch sub-child classes? I appreciate your help.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy