Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6746813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:22:01+00:00 2026-05-26T12:22:01+00:00

Below is a condensed version of a XML file provided by a different business

  • 0

Below is a condensed version of a XML file provided by a different business unit. What I need to get the value of is DriverInputSetGoodStudent.

This is how I am approaching this:

//session/data/policy/line/child::vehicle[position()=1]

That gets me the first vehicle in the XML, so then I will know the ID of the driver of that vehicle based on the GoverningDriverIdInfo/ItemId. Then I need to match that ID with the id property of the driver node. Then get the value of the DriverInputSetGoodStudent node.

<session>
<data>
    <policy>
        <line>
            <driver id="d4A5D51CEC4C14D3C9754A59AE09EFF9B" deleted="0" description="OH Edge, Teresa / 321654654">
                <DriverTrainingInd>N</DriverTrainingInd>
                <DriverInputGoodStudent>N</DriverInputGoodStudent>
                <DriverInputSetDriverTraining>0</DriverInputSetDriverTraining>
                <DriverInputSetGoodStudent>0</DriverInputSetGoodStudent>
                <DriverInputAccidentPreventionTrainingDate>2011-05-05</DriverInputAccidentPreventionTrainingDate>
                <AccidentPreventionCourse>0</AccidentPreventionCourse>
                <AccidentPreventionCoursePreviousValue>0</AccidentPreventionCoursePreviousValue>
                <DriverTrainingPrevValue>0</DriverTrainingPrevValue>
                <DriverOutputGoodStudent>No</DriverOutputGoodStudent>
            </driver>
            <vehicle id="v1CFDF4006D7C41D8B8C8A510E4C5C2E1" deleted="0" description="TYTA CAMRY BASE/LE/SE/XLE, 2010, 4T1BF3EK3AU522985">
                <VehicleInputPrimaryDriver>d4A5D51CEC4C14D3C9754A59AE09EFF9B</VehicleInputPrimaryDriver>
                <GoverningDriverIdInfo>
                  <ItemIdList>d4A5D51CEC4C14D3C9754A59AE09EFF9B</ItemIdList>
                  <ItemId>d4A5D51CEC4C14D3C9754A59AE09EFF9B</ItemId>
                </GoverningDriverIdInfo>
                <PrimaryDriverID>d4A5D51CEC4C14D3C9754A59AE09EFF9B</PrimaryDriverID>
                <VehicleGoodStudent>No</VehicleGoodStudent>
                <VehicleDriverTraining>No</VehicleDriverTraining>
            </vehicle>
        <line>
    <policy>
<data>
<session>

I see that the code didn’t paste in the quite correctly, there is an “end session” tag that isn’t appearing in the code block. Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:22:02+00:00Added an answer on May 26, 2026 at 12:22 pm

    If you have the id somewhere :

    <xsl:variable name="driverID" select="data/policy/line/child::vehicle[position()=1]/GoverningDriverIdInfo/ItemId"/>
    

    You can simply use it to find the desired node :

    <xsl:variable name="targetNode" select="data/policy/line/driver[@id = $driverID]/DriverInputSetGoodStudent"/>
    

    Update answer :

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="xml" indent="yes"/>
    
      <xsl:template match="/">
        <xsl:for-each select="//session">
          <xsl:message terminate="no">
            <xsl:value-of select="data/policy/line/driver[@id = current()/data/policy/line/child::vehicle[position()=1]/GoverningDriverIdInfo/ItemId]/DriverInputSetGoodStudent"/>
          </xsl:message>
        </xsl:for-each>
      </xsl:template>
    </xsl:stylesheet>
    

    Output :

     [xslt] : Warning! 0
    

    Where 0 is the value of your desired node. No variables used. I thought it was clear how to combine the two variables which were used only for proving a concept.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get the javascript code below to work with any of the
Below is the code for my player which will automatically generate a playlist.xml file
Below is my query. Is this righ? SQL> select case when value in (1000)
Below is part of the XML which I am processing with PHP's XSLTProcessor :
Below is my snapshot. In this snapshot I have to make the boot control
See the code sample below. I need the ArrayList to be a generic List.
below I have a query that will get the most common user agents for
Below is a loop that creates six boxes with different colors. When clicking on
Below command returns with time stamp, how do I get rid of the time:
Below are the contents of the array. How can I get the last array,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.