0

This is my first foray into XML. I'm trying to understand Java-based XML pipeline processing structure, but I'm a bit confused by the usage of XPath.. basic abbreviated structure is as follows. In particular, I am trying to wrap my head around the pipeline schema for the XNAT database.

<Pipeline>
    <documentation>
        <author>
        </author>
        <input-parameters>
            <parameter>
                <name>example_parameter</name>
                <values><schemalink>xnat:imageSessionData/ID</schemalink></values>
            </parameter>
        </input-parameters>
    </documentation>     
    <outputFileNamePrefix>^concat(/Pipeline/parameters/parameter[name='workdir']/values/unique/text(),'/DicomToNifti')^</outputFileNamePrefix>
    <loop id="series" xpath="^/Pipeline/parameters/parameter[name='scanids']/values/list^"/>
    <parameters>
        <parameter>
            <name>workdir</name>
            <values>
                <unique>^concat(/Pipeline/parameters/parameter[name='builddir']/values/unique/text(),'/',/Pipeline/parameters/parameter[name='sessionId']/values/unique/text())^</unique>
            </values>
        </parameter>
    </parameters>
</Pipeline>

If I am understanding correctly, the <outputFileNamePrefix> element is using XPath to select the value of the workdir parameter... which itself seems to be a slightly different XPath expression to a similar parameter with the name builddir, but that parameter does not seem to exist anywhere within the pipeline schema... the overall project is probably a little too involved to include in a stack exchange question, but perhaps someone could point me in the right direction...

Again, the code above has been abbreviated. The full .xml can be found here.

Ken White
  • 123,280
  • 14
  • 225
  • 444
reas0n
  • 469
  • 4
  • 16
  • 1
    I've no idea what XNAT is, and its web site makes no attempt to be useful to someone who doesn't already know what it is. (I got more information from the SO tag expansion than anything else). The key point is that to understand this XML, or any XML, you need a mixture of intuition and documentation. Yes, it looks very much as if this XML is using XPath expressions to somehow link from one part of the document to another. Beyond that, your guess is as good as mine. What exactly is your question? – Michael Kay Aug 24 '16 at 20:54
  • XNAT is a webapp database that uses postgres to organize and store images. It also has a java based engine that executes these pipelines (operations to automatically perform when an image is uploaded), in this case, the goal here is converting from one image format to another. The pipeline engine uses the XMLs somehow to build a string, the same thing you would type into the command line to do the conversion manually ... I guess the explicit question is: where should I look for `builddir`? – reas0n Aug 25 '16 at 14:08
  • Maybe a better question is "what is this XPath expression resolving to?" `^concat(/Pipeline/parameters/parameter[name='builddir']/values/unique/text(),'/',/Pipeline/parameters/parameter[name='sessionId']/values/unique/text())^` – reas0n Aug 25 '16 at 15:07
  • Well, if evaluated against this document, then it evaluates to the string "/", which may or may not be what was intended, but what it means is anyone's guess. (But you said you abbreviated the document, so perhaps you've left out what was important.) – Michael Kay Aug 25 '16 at 15:28
  • I linked the full document. But even then, I don't see any with a of `builddir` or `sessionId` in the full Pipeline XML, so I tend to agree that it should resolve to "/" ... the thing is, this pipeline is actually in working implementation, which is why I am confused... is it possible for that expression to be evaluated against a different document? – reas0n Aug 25 '16 at 15:33
  • Anything is possible. – Michael Kay Aug 25 '16 at 15:48
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/121854/discussion-between-elijah-rockers-and-michael-kay). – reas0n Aug 25 '16 at 15:51
  • I won't be able to help you. You need someone who understands this particular XML document format. – Michael Kay Aug 26 '16 at 08:15

1 Answers1

0

There are certain fields that are given for 'free' in XNAT, that don't appear explicity in the pipeline XML. For anyone else that requires illumination, you can check this post on the XNAT user's group.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
reas0n
  • 469
  • 4
  • 16