Menu

instance()

2011-05-19
2012-12-21
  • Nobody/Anonymous

    Does XSLTForms support the instance function? I am trying the following but I don't see any output.

          <xf:instance id="TestInstanceId" xmlns="">
            <SomeNode>
              Some Test Value
            </SomeNode>
          </xf:instance>
    

    and the following to display it

    <xf:output ref="instance('TestInstanceId')/SomeNode" />
    

    Any help is appreciated.
    Thanks!

     
  • Grégoire Colbert

    Hi!

    Yes the instance function is supported.

    I'm not sure what your problem is, but maybe you could try this :

    <xf:instance id="TestInstanceId">
      <dummy xmlns="">
        <SomeNode> Some Test Value </SomeNode>
      </dummy>
    </xf:instance>
    

    Then you will not mention the "dummy" element in your output, so it remains :

    <xf:output ref="instance('TestInstanceId')/SomeNode" />

    If this still doesn't work, try to add the id of your model (not the id of the instance!) in a "model" attribute of your xf:output.

    Hope this helps!

    Grégoire

     
  • kurtrips

    kurtrips - 2011-05-19

    Thanks. Your suggestion worked though I do not understand why the dummy does not need to be in the xpath.

     

Log in to post a comment.