XML Addon Questions

Home Forums Problems and solutions in GDL GDL add-ons XML Addon Questions

This topic contains 1 reply, has 2 voices, and was last updated by  Gergely Fehér 10 months, 3 weeks ago.

  • Author
    Posts
  • #2929

    Joachim Sühlo
    Participant

    See the following XML-Code:

      <?xml version="1.0" encoding="UTF-8"?>
    <database>
      <product id="ABC-DEF-GHI-123-456-781">
        <product_infos><![CDATA[FRA-010593|FRA-010593-A-stop|0|0.0|36|0|0|0|032.5|147.5|]]></product_infos>
        <product_infos><![CDATA[FRA-204699|FRA-204699-stop|0|0.0|36|0|0|0|090.0|]]></product_infos>
        <product_infos><![CDATA[FRA-010592|FRA-010592-A-stop|0|0.0|204|0|0|0|055.0|125.0|]]></product_infos>
      </product>
      <product id="ABC-DEF-GHI-123-456-785">
        <product_infos><![CDATA[FRA-010593|FRA-010593-A-stop|0|0.0|36|0|0|0|032.5|147.5|]]></product_infos>
        <product_infos><![CDATA[FRA-204699|FRA-204699-stop|0|0.0|36|0|0|0|090.0|]]></product_infos>
        <product_infos><![CDATA[FRA-010592|FRA-010592-A-stop|0|0.0|214|0|0|0|055.0|125.0|]]></product_infos>
      </product>
      <product id="ABC-DEF-GHI-123-456-789">
        <product_infos><![CDATA[FRA-010593|FRA-010593-A-stop|0|0.0|36|0|0|0|032.5|147.5|]]></product_infos>
        <product_infos><![CDATA[FRA-204699|FRA-204699-stop|0|0.0|36|0|0|0|090.0|]]></product_infos>
        <product_infos><![CDATA[FRA-010592|FRA-010592-A-stop|0|0.0|214|0|0|0|055.0|125.0|]]></product_infos>
      </product>
    </database>

    1. Is it possible, to move to product target nodes directly, by using the ID in the request?
    2. How do I extract the CDATA section?
    3. Would it be more easy to change the XML file?

    GDL Object Developer
    b-prisma
    MAC OSx 10.11

  • #2931

    Gergely Fehér
    Keymaster

    Hi Joachim,

    Here is a post about reading xml files: http://gdl.graphisoft.com/tips-and-tricks/how-to-use-the-gdl-xml-add-on/ In this sample you can check moving to a node with a name – so I think that you can jump to a product node, and check the ID in different steps. There is an example for getting the info from CDATA too.

    Gergely Fehér
    Team Leader, Library Team
    GRAPHISOFT SE

You must be logged in to reply to this topic.