Jump to content
Sign in to follow this  

How do I display CommercialVehicleFlag?

Recommended Posts

Here is my sample xml document with 2 Charges. Each Charge has a child element (Vehicle) which has the CommercialVehicleFlag.
Sometimes a xml document may have under Integration, a Citation which will have
CommercialVehicleFlag (xpath) /Integration/Citation/CommercialVehicleFlag).
or for this particular xml document
For that reason I need to check CommercialVehicleFlag from tow different places (xpaths) so as to display them based on where they are located. Either under Citation or under Charge.
Desired output
<Charge ID="10905889">        <Vehicle>            <CommercialVehicleFlag>false</CommercialVehicleFlag>        </Vehicle>    </Charge>    <Charge ID="10905890">        <Vehicle>            <CommercialVehicleFlag>true</CommercialVehicleFlag>        </Vehicle>    </Charge>

My sample xml document. Sometimes a document may have Citation with Vehicle and CommercialVehicleIndicator. The xml document will never have both Citation and Charge at the same time.

<Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="DL Notice to DVS" MessageID="67084403" xmlns="">    <Case Op="E" InternalID="1617090273" ID="12124494" xmlns:user="http://tylertechnologies.com">        <Charge ID="10905889">            <Vehicle>                <CommercialVehicleFlag>false</CommercialVehicleFlag>            </Vehicle>        </Charge>        <Charge ID="10905890">            <Vehicle>                <CommercialVehicleFlag>true</CommercialVehicleFlag>            </Vehicle>        </Charge>    </Case></Integration>
My xsl line of code which is returning false for both


My xsl line of code

<xsl:value-of select="(/Integration/Citation/Vehicle[CommercialVehicleFlag]|/Integration/Case/Charge/Vehicle[CommercialVehicleFlag])[1]/CommercialVehicleFlag"/>
Edited by winkimjr2

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...