Menu

Building XML from Scratch

2009-04-02
2013-05-15
  • nagamy long

    nagamy long - 2009-04-02

    Is VTD-XML meant for bulding XML from scratch, i.e.: creating XML file from POJO, not editing from existing XML? Is there any example available?

     
    • jimmy zhang

      jimmy zhang - 2009-04-02

      vtd-xml doesn't offer utitlities for composing XML per se yet, we are still open
      to this possblilty in the future... what kind of XML building utility that you hhave in mind.. have you checked out similar utility from other APIs?

       
    • nagamy long

      nagamy long - 2009-04-06

      Consider this scenario:

      Client pass in parameters in xml ( a schema has been defined ) to lookup for details:

      input:
      <REQUEST>
      <CD>
      <TITLE>Empire Burlesque</TITLE>
      </CD>
      <CD>
      <TITLE>Hide your heart</TITLE>
      </CD>
      </REQUEST>

      output:
      <RESPONSE>
      <CD>
      <TITLE>Empire Burlesque</TITLE>
      <ARTIST>Bob Dylan</ARTIST>
      <COUNTRY>USA</COUNTRY>
      <COMPANY>Columbia</COMPANY>
      <PRICE>10.90</PRICE>
      <YEAR>1985</YEAR>
      </CD>
      <CD>
      <TITLE>Hide your heart</TITLE>
      <ARTIST>Bonnie Tyler</ARTIST>
      <COUNTRY>UK</COUNTRY>
      <COMPANY>CBS Records</COMPANY>
      <PRICE>9.90</PRICE>
      <YEAR>1988</YEAR>
      </CD>
      </RESPONSE>

      Would you recommend VTD-XML for this?

      Please note that the root element for input is <REQUEST> whereas the root element for response is <RESPONSE>.

       
      • jimmy zhang

        jimmy zhang - 2009-04-07

        Can you give it some thought as to
        1. what vtd-xml should provide to serialize XML that other tools don't yet provide?

        Can you just use simple text concatnation?

         

Log in to post a comment.