I have a DropDownList that is populated by the Aircraft ID attributes from the XML file below. I have been successful in using the DropDownList.SelectedValue to display the Aircraft Make, Model, and Type in a listview. My problem is, now how can I loop through
the checklists and tasks and display them for the selected Aircraft? My initial idea was to use an XSLT but I have been unsuccessful with the DataSource Implementation so far. I was able to create the desired layout with an XML control and a XSLT but I can't
figure out how to pass the dropdownlist.selectedvalue to filter the selection. Any help or ideas you guys could provide to point me in the right direction would be greatly appreciated.
You're going to need a data control to display it somewhere. Set the datacontrols source = <information you want> where Aircraft = dropdown.selectedvalue.
is passed to the XPath of the XMLDataSource and is working as intended. I am having trouble creating a XSLT that displays the data properly.
I was successful in creating the following XSLT which works in <ASP:XML> but using this method, I don't know how to use the dropdownlist to filter the data to one Aircraft.
is passed to the XPath of the XMLDataSource and is working as intended.
Hello:)
First congratulations!
red9r
I am having trouble creating a XSLT that displays the data properly.
I was successful in creating the following XSLT which works in <ASP:XML> but using this method, I don't know how to use the dropdownlist to filter the data to one Aircraft.
Then due to your current question,I think since your ID is unique,So there'd be only one Aircraft choosen……
My suggestion is that you should:
1)Make Dropdownlist's AutoPostBack =true。
2)Then double-click the Dropdownlist,and then write down the codes below:
Thank you for your assistance but the problem with that solution is that the XML Web Server Control doesn't accept an XPath therefore I I can't seem to filter the output down to one aircraft.
I tried using a Listview which does accept an XPath and with this method I can get the dropdown list to filter the selection down to one aircraft with the datacontrol above. However, when I use the Listview, I cannot get the xslt to transform the data into
the format that I am trying to achieve.
red9r
0 Points
3 Posts
XSLT help!
May 30, 2012 11:44 PM|LINK
I have a DropDownList that is populated by the Aircraft ID attributes from the XML file below. I have been successful in using the DropDownList.SelectedValue to display the Aircraft Make, Model, and Type in a listview. My problem is, now how can I loop through the checklists and tasks and display them for the selected Aircraft? My initial idea was to use an XSLT but I have been unsuccessful with the DataSource Implementation so far. I was able to create the desired layout with an XML control and a XSLT but I can't figure out how to pass the dropdownlist.selectedvalue to filter the selection. Any help or ideas you guys could provide to point me in the right direction would be greatly appreciated.
The layout I am try to achieve is:
Piper Warrior II P28A-161
Preflight
Task1
Task2
Task3
Task4
etc.
Before Engine Start
Task1
Task2
Task3
etc.
A sample of my XML file:
<?xml version="1.0" encoding="utf-8" ?> <AIRCRAFTS> <AIRCRAFT ID="N817AC"> <AIRCRAFTMAKE>Piper</AIRCRAFTMAKE> <AIRCRAFTMODEL>Warrior II</AIRCRAFTMODEL> <AIRCRAFTTYPE>P28A-161</AIRCRAFTTYPE> <CHECKLISTS> <NORMAL> <CHECKLIST NAME="Preflight"> <TASK Type="Conditional"> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>WEIGHT AND BALANCE, TOLD, PERFORMANCE</ACTION> <CONDITION>CHECKED</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>COVER</ACTION> <CONDITION>REMOVED AND STORED</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>FUEL SAMPLE WASTE CAN</ACTION> <CONDITION>OBTAIN</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>Interior Check</ACTION> <CONDITION>None</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>CONTROL WHEEL</ACTION> <CONDITION>UNSECURED</CONDITION> </TASK> </CHECKLIST> <CHECKLIST NAME="Before Engine Start"> <TASK> <PREREQUISITE> None/Task </PREREQUISITE> <ASSOCIATION> None/Emergency Checklist </ASSOCIATION> <ACTION/> <CONDITION/> </TASK> </CHECKLIST> </NORMAL> <EMERGENCY/> </CHECKLISTS> </AIRCRAFT> <AIRCRAFT ID="N756A"> <AIRCRAFTMAKE>Piper</AIRCRAFTMAKE> <AIRCRAFTMODEL>Seminole</AIRCRAFTMODEL> <AIRCRAFTTYPE>PA44</AIRCRAFTTYPE> <CHECKLISTS> <NORMAL> <CHECKLIST NAME="Preflight"> <TASK Type="Conditional"> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>WEIGHT AND BALANCE, TOLD, PERFORMANCE</ACTION> <CONDITION>CHECKED</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>COVER</ACTION> <CONDITION>REMOVED AND STORED</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>FUEL SAMPLE WASTE CAN</ACTION> <CONDITION>OBTAIN</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>Interior Check</ACTION> <CONDITION>None</CONDITION> </TASK> <TASK> <PREREQUISITE>None</PREREQUISITE> <ASSOCIATION>None</ASSOCIATION> <ACTION>CONTROL WHEEL</ACTION> <CONDITION>UNSECURED</CONDITION> </TASK> </CHECKLIST> <CHECKLIST NAME="Before Engine Start"> <TASK> <PREREQUISITE> None/Task </PREREQUISITE> <ASSOCIATION> None/Emergency Checklist </ASSOCIATION> <ACTION/> <CONDITION/> </TASK> </CHECKLIST> </NORMAL> <EMERGENCY/> </CHECKLISTS> </AIRCRAFT> </AIRCRAFTS>mth13
Member
331 Points
96 Posts
Re: XSLT help!
May 31, 2012 02:45 PM|LINK
You're going to need a data control to display it somewhere. Set the datacontrols source = <information you want> where Aircraft = dropdown.selectedvalue.
red9r
0 Points
3 Posts
Re: XSLT help!
May 31, 2012 05:56 PM|LINK
The working datacontrol
is passed to the XPath of the XMLDataSource and is working as intended. I am having trouble creating a XSLT that displays the data properly.
I was successful in creating the following XSLT which works in <ASP:XML> but using this method, I don't know how to use the dropdownlist to filter the data to one Aircraft.
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <p> <xsl:value-of select="AIRCRAFTS/AIRCRAFT/AIRCRAFTMAKE" />  <xsl:value-of select="AIRCRAFTS/AIRCRAFT/AIRCRAFTMODEL" />  <xsl:value-of select="AIRCRAFTS/AIRCRAFT/AIRCRAFTTYPE" /> </p> <xsl:for-each select="AIRCRAFTS/AIRCRAFT/CHECKLISTS/NORMAL/CHECKLIST"> <h2><u><xsl:value-of select="@NAME"/></u></h2> <xsl:for-each select="TASK"> <li><xsl:value-of select="ACTION"/>..................<xsl:value-of select="CONDITION"/></li> </xsl:for-each> <p /> </xsl:for-each> </xsl:template> </xsl:stylesheet>Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: XSLT help!
Jun 02, 2012 01:12 AM|LINK
Hello:)
First congratulations!
Then due to your current question,I think since your ID is unique,So there'd be only one Aircraft choosen……
My suggestion is that you should:
1)Make Dropdownlist's AutoPostBack =true。
2)Then double-click the Dropdownlist,and then write down the codes below:
3)Then apply your xslt file in the event to output what you want.
red9r
0 Points
3 Posts
Re: XSLT help!
Jun 05, 2012 11:25 AM|LINK
Thank you for your assistance but the problem with that solution is that the XML Web Server Control doesn't accept an XPath therefore I I can't seem to filter the output down to one aircraft.
I tried using a Listview which does accept an XPath and with this method I can get the dropdown list to filter the selection down to one aircraft with the datacontrol above. However, when I use the Listview, I cannot get the xslt to transform the data into the format that I am trying to achieve.