Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?><document>
  2. <node id="n0">
  3. <data key="d6">
  4. <y:GenericNode configuration="TEXT I WANT TO GET">
  5. <y:Geometry height="56.030557066666574" width="181.68810666666667" x="638.4599149206349" y="143.24969103333325"/>
  6. <y:Fill color="#FFCC66" color2="#FF9900" transparent="false"/>
  7. <y:BorderStyle color="#000000" type="line" width="1.0"/>
  8. <y:NodeLabel alignment="center" autoSizePolicy="node_width" configuration="CroppingLabel" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="34.265625" horizontalTextPosition="center" iconTextGap="4" modelName="custom" textColor="#000000" verticalTextPosition="bottom" visible="true" width="181.68810666666667" x="0.0" y="10.882466033333287">Text I want to Get<y:LabelModel>
  9. <y:SmartNodeLabelModel distance="4.0"/>
  10. </y:LabelModel>
  11. <y:ModelParameter>
  12. <y:SmartNodeLabelModelParameter labelRatioX="-0.5" labelRatioY="0.0" nodeRatioX="-0.5" nodeRatioY="0.0" offsetX="0.0" offsetY="0.0" upX="0.0" upY="-1.0"/>
  13. </y:ModelParameter>
  14. </y:NodeLabel>
  15. </y:GenericNode>
  16. </data>
  17. </node>
  18.  
  19. <?php
  20. $xml = simplexml_load_file("testxml.xml")
  21. or die("Error: Cannot create object - check that the XML file exists and is
  22. not corrupted"); print_r($xml);
  23. echo $xml->node[0]['id']; // This works
  24. echo $xml->node[0]->data[0]['key']; // This works
  25.  
  26. echo $xml->children('y', true)->GenericNode->attributes()->configuration; // Nothing
  27.  
  28. echo $xml->children('y', true)->GenericNode->NodeLabel; // Nothing
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement