Announcement

Collapse
No announcement yet.

Transforming to xml

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transforming to xml

    While I still have some design decisions on how best to do this. Today I am transforming the incoming message to an XML format. If I use plain XML without an XSD I have to write some code that is hard to maintain to dynamically build the xml.

    e.g.

    for (i=0; i< msg['definition']['attributes']['children'].length(); i++) {
    // expand XML
    tmp['ArchetypeClusterModel'][i] = "<ArchetypeClusterModel><activeInd>1</activeInd><archetypeCategoryRef><id>0</id><display></display><idvalue></idvalue></archetypeCategoryRef><archetypeClusterId>0</archetypeClusterId><archetypeClusterRef><id>...... etc ";
    }
    // populate
    tmp['ArchetypeClusterModel'][i]['archetypeClusterRef']['idvalue'] = msg['definition']['attributes']['children']['rm_type_name'].toString();
    }

    Is there any plans to be able to define an XSD so I can programmtically extends the model e.g.

    for (i=0; i< msg['definition']['attributes']['children'].length(); i++) {
    // expand XML
    tmp['ArchetypeClusterModel'][i] = new tmp['ArchetypeClusterModel'];
    // populate
    tmp['ArchetypeClusterModel'][i]['archetypeClusterRef']['idvalue'] = msg
    }

  • #2
    Re:Transforming to xml

    Hi.

    I can't understand you well: incoming messages are allways transformed to XML (mirth works internaly with XML). Why you need XSD ? Why can't you use an output template ?

    Comment

    Working...
    X