Export XML

22 Apr '14, 02:16 PM
24,225 Views
Forum Forum Starter - Level 3

Hello.

 

I want to export a xml, for example:

<?xml version="1.0" encoding="utf-8"?>  
<item xmlns="http://sedici.unlp.edu.ar">  
    <title>Agile managing of web requirements with WebSpec</title>
    <id>25670</id>  
    <tipo>paper</tipo>  
    <metadatos>
        <id>25</id>
        <valor>Pages 12</valor>
    </metadatos>
    <metadatos>
        <id>31</id>
        <valor>Jose Sanchez</valor>
    </metadatos>
    <metadatos>
        <id>64</id>
        <valor>UNET</valor>
    </metadatos>
</item>

 

My schema (XSD ) is:
<?xml version="1.0" encoding="utf-16"?>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="item">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="title" type="xsd:string" />
        <xsd:element name="id" type="xsd:int" />
        <xsd:element name="tipo" type="xsd:string" />
        <xsd:element name="metadatos">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="id" type="xsd:int" />
              <xsd:element name="valor" type="xsd:string" />
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

 

Then, I create the following in WebRatio:
- XSD Provider
- XSD Resource

 

The following were generated virtual entities in my data model:

- Item (oid, title, ID, tipo)

- Item_metadata (oid, ID, valor)


My XSD is translated into Data Model elements is:
<Package id="pkg1" name="xSDProvider1" xmlns:gr="http://www.webratio.com/2006/WebML/Graph" gr:x="30" gr:y="575">
  <Package id="pkg2" name="sedici" gr:x="0" gr:y="0">
    <Entity id="ent9" name="item" duration="volatile" volatileStorage="database" xmlns:wrxsd="http://www.webratio.com/2012/WebML/WRXSD" wrxsd:provider="xsdp1" wrxsd:type="item[Element]" gr:x="0" gr:y="0">
      <Attribute id="att31" name="oid" type="integer" key="true"/>
      <Attribute id="att32" name="title" type="string" key="false" wrxsd:element="title"/>
      <Attribute id="att33" name="ID" type="integer" key="false" wrxsd:element="id"/>
      <Attribute id="att34" name="tipo" type="string" key="false" wrxsd:element="tipo"/>
    </Entity>
    <Entity id="ent10" name="item_metadatos" duration="volatile" volatileStorage="database" xmlns:wrxsd="http://www.webratio.com/2012/WebML/WRXSD" wrxsd:provider="xsdp1" wrxsd:type="item/metadatos[Element]" gr:x="210" gr:y="13">
      <Attribute id="att35" name="oid" type="integer" key="true"/>
      <Attribute id="att36" name="ID" type="integer" key="false" wrxsd:element="id"/>
      <Attribute id="att37" name="valor" type="string" key="false" wrxsd:element="valor"/>
    </Entity>
  </Package>
</Package>

 

In my hypertext model, I added a "XML I/O" and a "Get XML"

 

When I try to export my XML, the web page does nothing.

 

The reference example I have is XML Schema Definition Support ( by Laura Cigardi ) http://www.webratio.com/learn/learningobject/XML-Schema-Definition-Support?link=oln1x.redirect&nav=16#!ajax=true

 

Any suggestions or examples with code, because I think I'm doing something wrong.

 

Regards,

Jose

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 8

Hi Jose,

it seems that you did everything correctly.

Check whether you configured properly the XML I/O operation.

Did you choose the "Export" mode?

Did you select the Entity to export?

In the article you mentioned there is a Script component that takes the XML resulting from the XML I/O operation and do something before passing it to the field of the form. Do you have the script of the Script component? 

If you are getting an empty page, maybe the application raised an exception that can be found in the application logs. Just check in the web application folder under the WEB-INF/log directory and read through the RTXError.log file. You may find here which is exactly the problem.

 
x 0
Answer at this question and get points!

Related questions

Acceder a diferentes site views/ Acces to diferents site views Add to Bag link in ACME any webratio book ? Asking For a Book Attribute comparison in a selector unit Clarification about the NoOperation unit Codigo QR Como hacer un menu en webratio? Conditional Expression "greater than 0" on null fields Connect more query unit Content module page variable won't assign. Convert selector component result to single value Could not open the editor: This copy of WebRatio is not registered coupled mandatory fields Create Unit with Date (Year only) Custom Attributes Condition Database Database List is not showing up in App Emulator Data is always created doubled Data Management: Updating Data - Attachments - Updating Data Sample Project Final Description: Unknown tag 'wr:LinkResource' Dudas sobre modelado(Data Flow,Forms y Operation Create) Empty record mistakenly saved en_US codify problem external link.= Filter information in a Simple List Format currency forward/backward navigation and bookmark in ajax web app "Generation Error" with Generate and Run Generation options problem get the attachment files of an email Get Unit problem Get Year from Date Help for connect public and private site views How can i create pagemenu or landmarkmenu with multiple levels. How can I import a view in the Domain Model as an attribute of an Entity? How does WebRatio represent these IFML elements? / ¿Cómo representa WebRatio estos elementos IFML? How i can reuse modules in multiple projects? How to define the sequence of execution units on a page? How to display the attributes of a related entity. How to filter imported attributes? How to include Selector Unit result in Mail Unit Body? How to pass vars to a alternative page How to process IFML Model (build with Eclipse editor) with ATL How to show a page based on a boolean? How to speed up the "last" link using PowerIndexUnit for lots of records How to store data related to an entity in relationships in a project web Import an XPDL 2.2 file into a BPM Project Importing JAR Libraries into Script Unit Insert data into database Insert master page to many hybrid modules Integrating a BPM model into an existent WebML model JSON I/O Unit e informazioni derivate KO Links in Selector Unit Landmark in hybrid module Link localization Links from Index unit with condition Link Visibility Condition Power Index Unit Mail multipla maintain the record order in a sortable list Math Unit to update attributes of an entity? Missing units when importing project [MOBILE] How I extract information from JSON client side? Modifica Entità tramite file xml Multi Entry Unit: How to forward only checked rows? multi-lingual product description Non riesco a fare funzionare Xml out unit Parametrizzazione Selector Unit Problem Example create Unit (no company in employee table) Problem in adding diagrams in IFML Editor (Eclipse) Problem with query unit! Problem with Scroller Unit Process model import in other languages query a database Question about Site Views Rename passing attributes Replace ID by its value in another table Search by Selector component does not work Select between parameters Selector unit doesn't return any value in hybrid module Sending mails is not working Sending mails with gmail is not working Setting the Default link for a Switch unit show/hide fields on button click (registration page) [solved] all links transparent, why ? Something leads to wrong condition expression evaluation. sumar atributos de una tabla filtrado por Role Condition Sum entity's values Transportation Link issue Unique Fields using relationship role conditional with null usuarios y grupos utilizzo componenti database Visibility Condition on Multiple Links From Index Unit Web Ratio Mobile and Foreign Key WebRation - Create Navigation diagram WebRatio no imports all attributes (fields) of a table