Jump to content

Search the Community

Showing results for tags 'xslt'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 63 results

  1. Hi everyone, I try to convert an XML file to a HTML page but nothing is displayed. in the following, i put the XML code, the xslt code and the HTML page. Thank you for your help. the XML code <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="fg.xsl" ?> <cuimodel> <window id='window1'> <div> <label id='label1'> searchPreference </label> <label id='label12'> seeFirst </label> <combobox id='CB1' name='criteriaCB'> <item>promotions</item> <item>BestRated </item> </combobox> </div> <div> <label id='label2'> mon </label> <label id='label21'> second </label> <combobox id='CB2' name='DispLayout'> <item>GridLayout</item> <item>listlayout</item> </combobox> </div> <div> <label id='label13'> Preference </label> <label id='label122'> see </label> <combobox id='CB3' name='CT'> <item>HighContrast</item> <item>LowContrast</item> </combobox> </div> <button>cancel</button> <button>ok</button> </window> </cuimodel> the XSLT code <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <xsl:for-each select="div"> <xsl:for-each select="label"> <label> <xsl:value-of select="."/> </label> <select> <xsl:for-each select="combobox"> <option> <xsl:value-of select="item"/> </option> </xsl:for-each> </select> </xsl:for-each> <xsl:for-each select="button"> <button> <xsl:value-of select="."/> </button> </xsl:for-each> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> and the HTML page
  2. I'm trying to split the elements into new elements, from this format : <CTP> <name>ABSA bank</name> <BAs.BA>bank|sector|issuer</BAs.BA> <altIDs.altID.label_altSystem>ABSB_BBG|ASB_Reuters</altIDs.altID.label_altSystem> </CTP> to this format: <CTP> <name>ABSA bank</name> <BAs> <BA>bank</BA> <BA>sector</BA> <BA>issuer</BA> </BAs> <altIDs> <aldID> <label>ABSB</label> <altSystem>BBG</altSystem> </aldID> <aldID> <label>ASB</label> <altSystem>Reuters</altSystem> </aldID> </altIDs> </CTP> What I did so far is to transform this format: <CTP> <name>ABSA bank</name> <BAs.BA>bank|sector|issuer</BAs.BA> <FAs.FA.F>dep|sec|issue</FAs.FA.F> </CTP> to this formmat : <?xml version="1.0" encoding="UTF-8"?> <CTP> <name>ABSA bank</name> <BAs> <BA>bank</BA> <BA>sector</BA> <BA>issuer</BA> </BAs> <FAs> <FA> <F>dep</F> <F>sec</F> <F>issue</F> </FA> </FAs> </CTP> Using this Code with the help of @michael.hor257k <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> <!-- identity transform --> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="*[contains(name(), '.')]" name="nest"> <xsl:param name="name" select="name()"/> <xsl:param name="delimiter" select="'.'"/> <xsl:choose> <xsl:when test="contains($name, $delimiter)"> <xsl:element name="{substring-before($name, $delimiter)}" > <!-- recursive call --> <xsl:call-template name="nest"> <xsl:with-param name="name" select="substring-after($name, $delimiter)"/> </xsl:call-template> </xsl:element> </xsl:when> <xsl:otherwise> <xsl:call-template name="tokenize"> <xsl:with-param name="name" select="$name"/> <xsl:with-param name="text" select="."/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="tokenize"> <xsl:param name="name"/> <xsl:param name="text"/> <xsl:param name="delimiter" select="'|'"/> <xsl:variable name="token" select="substring-before(concat($text, $delimiter), $delimiter)" /> <xsl:if test="$token"> <xsl:element name="{$name}" > <xsl:value-of select="$token"/> </xsl:element> </xsl:if> <xsl:if test="contains($text, $delimiter)"> <!-- recursive call --> <xsl:call-template name="tokenize"> <xsl:with-param name="name" select="$name"/> <xsl:with-param name="text" select="substring-after($text, $delimiter)"/> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> The tricky step that I need is how to use many delimiters and access layers and levels to write the needed XML format.
  3. I would like to use variable vCurrentPoStatus in the select statement below. The following select is not returning anything. <xsl:value-of select="Type/@Word"/> I would like to use variable vCurrentPoStatus inside this statement to get the @Word (DISMISSED). Desired output based on current xml document <NotificationEvent notificationType="ProtectionOrderInactivation" internalProtectionOrderID="11271" protectionOrderNumber="1605935" protectionOrderStatusDate="07/21/2016" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">DISMISSED</NotificationEvent> xslt code <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:if test="Integration/Case/SecurityGroup[not(contains(@Word,'SEAL'))] or not(Integration/Case/SecurityGroup)"> <xsl:call-template name="ProtectionOrderInactivation"/> </xsl:if> </xsl:template> <!-- --> <xsl:template name="ProtectionOrderInactivation"> <xsl:if test="Integration/ControlPoint='SAVE-PROTECTION-ORDER'"> <!-- Check for Dismissed --> <xsl:if test="Integration/Case/CaseType/@Word='DMA'"> <xsl:variable name="vControlPointTimestamp" select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> <xsl:for-each select="Integration/ProtectionOrder[@Op='E']/Statuses/Status[((@Op='A') or (@Op='E')) and ((Type/@Word='DISMISSED'))]"> <xsl:variable name="vCurrentPoStatus" select="Statuses/Status[((@Op='A') or (@Op='E'))][mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimestampCreate))) <=$vControlPointTimestamp][1]/Type/@Word"/> <xsl:if test="$vCurrentPoStatus ='DISMISSED'"> <NotificationEvent notificationType="ProtectionOrderInactivation"> <xsl:attribute name="internalProtectionOrderID"><xsl:value-of select="../../@InternalProtectionOrderID"/></xsl:attribute> <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="../../ProtectionOrderNumber"/></xsl:attribute> <xsl:attribute name="protectionOrderStatusDate"><xsl:value-of select="Date"/></xsl:attribute> <xsl:value-of select="Type/@Word"/> </NotificationEvent> </xsl:if> </xsl:for-each> </xsl:if> </xsl:if> </xsl:template> <!-- --> <msxsl:script language="JScript" implements-prefix="mscef"><![CDATA[ function formatDateTimeNumeric(sDate){ if(sDate.length==0){ return ""; } else{ var oDate=new Date(sDate); var str = oDate.getSeconds(); return "" + oDate.getFullYear().toString() + padZeroes(oDate.getMonth() + 1,2) + padZeroes(oDate.getDate(),2) + padZeroes(oDate.getHours().toString(),2) + padZeroes(oDate.getMinutes(),2) + padZeroes(oDate.getSeconds(),2); } } function fixOdysseyTimestamp(sDate){ /* Replace the ":" between seconds and miliseconds */ if(sDate.length==0){ return ""; } else{ var strParts1 = sDate.split(" "); var strTime = strParts1[1]; var strParts2 = strTime.split(":"); return strParts1[0] + " " + strParts2[0] + ":" + strParts2[1] + ":" + strParts2[2]; } } ]]></msxsl:script> </xsl:stylesheet> xml doc <Integration MessageGUID="79e1bb27-0a4d-47ec-a554-3b59c2518b89" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="IXML Case Notification Test" MessageID="96" xmlns=""> <ControlPoint Timestamp="7/21/2016 9:49:13 AM" UserID="tessing">SAVE-PROTECTION-ORDER</ControlPoint> <Case InternalID="1623057636" ID="14870832" xmlns:user="http://tylertechnologies.com"> <FiledDate>07/21/2016</FiledDate> <CaseCategory>FAM</CaseCategory> <CaseType Word="DMA">Domestic Abuse</CaseType> <SecurityGroup Word="CONFPOR">Conf - Protective Order</SecurityGroup> <ProtectionOrders> <ProtectionOrder Op="E" InternalProtectionOrderID="11271"> <Deleted>false</Deleted> <ProtectionOrderNumber>1605935</ProtectionOrderNumber> <Issued>07/21/2016</Issued> <Expiration>10/29/2016</Expiration> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>No</Active> <Date Op="A">07/21/2016</Date> <Type Op="A" Word="DISMISSED">Dismissed</Type> <TimestampCreate Op="A">07/21/2016 09:49:13:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>Yes</Active> <Date>07/21/2016</Date> <Type Word="SBJOCOR">Corrected - Signed By Judicial Officer</Type> <TimestampCreate>07/21/2016 09:48:58:313</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </ProtectionOrders> </Case> <Fees xmlns:user="http://tylertechnologies.com"/> <ProtectionOrder Op="E" InternalProtectionOrderID="11271" xmlns:user="http://tylertechnologies.com"> <Deleted>false</Deleted> <ProtectionOrderNumber>1605935</ProtectionOrderNumber> <Issued>07/21/2016</Issued> <Expiration>10/29/2016</Expiration> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>No</Active> <Date Op="A">07/21/2016</Date> <Type Op="A" Word="DISMISSED">Dismissed</Type> <TimestampCreate Op="A">07/21/2016 09:49:13:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>Yes</Active> <Date>07/21/2016</Date> <Type Word="SBJOCOR">Corrected - Signed By Judicial Officer</Type> <TimestampCreate>07/21/2016 09:48:58:313</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </Integration>
  4. I am using a variable vPoID to determine the right ProtectionOrder. Then I am displaying that PO's @InternalProtectionOrderID. I would also like to use the same variable to get that PO's ProtectionOrderNumber. How can I use the same variable to also get ProtectionOrderNumber? I would like to modify this line to use the variable vPoID to get the ProtectionOrderNumber <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="ProtectionOrderNumber"/></xsl:attribute> Expected output <NotificationEvent notificationType="ProtectionOrderHearing" internalProtectionOrderID="2552" protectionOrderNumber="1600330"/> xslt code <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mscef="courts.state.mn.us/extfun" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:if test="Integration/Case/SecurityGroup[not(contains(@Word,'SEAL'))] or not(Integration/Case/SecurityGroup)"> <xsl:call-template name="ProtectionOrderHearing"/> </xsl:if> </xsl:template> <!-- --> <xsl:template name="ProtectionOrderHearing"> <!--<xsl:if test="Integration/ControlPoint='SAVE-FAM-HEARING'">--> <xsl:if test="Integration/ControlPoint=('SAVE-FAM-HEARING') or ('SAVE-FAM-HEAR-CTS')"> <xsl:if test="Integration/Case/CaseType/@Word='DMA'"> <xsl:for-each select="Integration/Case"> <xsl:variable name="vFoundActivePO"> <xsl:for-each select="/Integration/ProtectionOrder[Deleted='false']"> <xsl:variable name="vControlPointTimestamp" select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> <xsl:variable name="vCurrentPoStatus" select="Statuses/Status[mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimestampCreate))) <=$vControlPointTimestamp][1]/Type/@Word"/> <xsl:if test="($vCurrentPoStatus ='SBJO') or ($vCurrentPoStatus='SBJOCOR')">HIT</xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="vFoundHearingTrigger"> <xsl:choose> <xsl:when test="count(Hearing[@Op='A'])>0">HIT</xsl:when> <xsl:when test="count(Hearing[@Op='D'])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (CancelledReason/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/HearingDate/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/CourtSessionBlock/StartTime/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing/Setting[@Op='A'])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/RescheduledType/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/CancelledReason/@Op='E')])>0">HIT</xsl:when> <xsl:when test="count(Hearing[(@Op='E') and (Setting/CourtSessionBlock/StartTime/@Op='E')])>0">HIT</xsl:when> </xsl:choose> </xsl:variable> <xsl:if test="(contains($vFoundHearingTrigger,'HIT')) and (contains($vFoundActivePO,'HIT'))"> <xsl:choose> <xsl:when test="count(Hearing/Setting[not(Cancelled)])>0"> <xsl:for-each select="Hearing/Setting[not(Cancelled)]"> <!-- WK 07/19/2016--> <xsl:variable name="vCurrentTimestamp"> <xsl:value-of select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> </xsl:variable> <xsl:variable name="vControlPointTimestamp" select="mscef:formatDateTimeNumeric(string(/Integration/ControlPoint/@Timestamp))"/> <!--WK 07/19/2016 variable to hold ProtectionOrders that have not been deleted--> <xsl:variable name="vPoID"> <!--WK 07/19/2016 Select all ProtectionOrder elements from the document that are not deleted--> <xsl:for-each select="//Integration/ProtectionOrder[Deleted='false']"> <xsl:variable name="vCurrentPoStatus" select="Statuses/Status[mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimestampCreate))) <=$vCurrentTimestamp][1]/Type/@Word"/> <xsl:if test="($vCurrentPoStatus ='SBJO') or ($vCurrentPoStatus='SBJOCOR')"> <xsl:value-of select="@InternalProtectionOrderID"/> </xsl:if> </xsl:for-each> </xsl:variable> <NotificationEvent notificationType="ProtectionOrderHearing"> <!--WK 07/19/2016 variable vPoID to get the right PO's attribute @InternalProtectionOrderID>--> <xsl:attribute name="internalProtectionOrderID"><xsl:value-of select="$vPoID"/></xsl:attribute> <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="ProtectionOrderNumber"/></xsl:attribute> </NotificationEvent> </xsl:for-each> </xsl:when> <xsl:otherwise> <NotificationEvent notificationType="ProtectionOrderHearing"> <xsl:attribute name="internalProtectionOrderID"><xsl:value-of select="//Integration/ProtectionOrder[Deleted='false'][count(Statuses/Status[(Type/@Word='SBJO') or (Type/@Word='SBJOCOR')])>0]/@InternalProtectionOrderID"/></xsl:attribute> <xsl:attribute name="protectionOrderNumber"><xsl:value-of select="//Integration/ProtectionOrder[Deleted='false'][count(Statuses/Status[(Current='true') and ((Type/@Word='SBJO') or (Type/@Word='SBJOCOR'))])>0]/ProtectionOrderNumber"/><xsl:value-of select="//Integration/ProtectionOrder[Deleted='false'][count(Statuses/Status[(Type/@Word='SBJO') or (Type/@Word='SBJOCOR')])>0]/ProtectionOrderNumber"/></xsl:attribute> <xsl:text>NoHearings</xsl:text> </NotificationEvent> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:for-each> </xsl:if> </xsl:if> </xsl:template> <!-- --> <msxsl:script language="JScript" implements-prefix="mscef"><![CDATA[ function formatDateTimeNumeric(sDate){ if(sDate.length==0){ return ""; } else{ var oDate=new Date(sDate); var str = oDate.getSeconds(); return "" + oDate.getFullYear().toString() + padZeroes(oDate.getMonth() + 1,2) + padZeroes(oDate.getDate(),2) + padZeroes(oDate.getHours().toString(),2) + padZeroes(oDate.getMinutes(),2) + padZeroes(oDate.getSeconds(),2); } } function currentDateTimeNumeric(){ var oDate=new Date(); var str = oDate.getSeconds(); return "" + oDate.getFullYear().toString() + padZeroes(oDate.getMonth() + 1,2) + padZeroes(oDate.getDate(),2) + padZeroes(oDate.getHours().toString(),2) + padZeroes(oDate.getMinutes(),2) + padZeroes(oDate.getSeconds(),2); } function fixOdysseyTimestamp(sDate){ /* Replace the ":" between seconds and miliseconds */ if(sDate.length==0){ return ""; } else{ var strParts1 = sDate.split(" "); var strTime = strParts1[1]; var strParts2 = strTime.split(":"); return strParts1[0] + " " + strParts2[0] + ":" + strParts2[1] + ":" + strParts2[2]; } } ]]></msxsl:script> </xsl:stylesheet> xml document <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="BCA PO Notification" MessageID="82119264" xmlns=""> <ControlPoint Timestamp="7/14/2016 9:00:52 AM">SAVE-FAM-HEARING</ControlPoint> <Case> <FiledDate>07/14/2016</FiledDate> <CaseCategory>FAM</CaseCategory> <CaseType Word="DMA">Domestic Abuse</CaseType> <BaseCaseType>Civil Domestic Violence</BaseCaseType> <SecurityGroup Word="CONFPOR">Conf - Protective Order</SecurityGroup> <Active>true</Active> <Deleted>false</Deleted> <Assignment Current="true"> <AssignmentDate>07/14/2016</AssignmentDate> <TimestampCreate>07/14/2016 08:56:32:707</TimestampCreate> </Assignment> <Hearing ID="175088126" InternalHearingEventID="1734552990"> <HearingType Word="ADJ">Adjudicatory Hearing</HearingType> <HearingTypeBaseCaseCategory>Criminal</HearingTypeBaseCaseCategory> <HearingTypeBaseCaseCategory>Family</HearingTypeBaseCaseCategory> <TimestampCreate>07/14/2016 08:58:22:160</TimestampCreate> <Setting ID="25760837" InternalSettingID="1625564128" Date="07/14/2016"> <HearingDate>07/14/2016</HearingDate> <StartTime>10:00 AM</StartTime> <EndTime>11:00 AM</EndTime> <CourtSessionName>Ad-Hoc_10-FA-16-40</CourtSessionName> <CourtSessionID ID="3862219" InternalCourtSessionID="1612936893"/> <Calendar Word="10GEN">New General Carver</Calendar> <CalendarBaseCaseCategory>Criminal</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Civil</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Family</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Probate or Mental Health</CalendarBaseCaseCategory> <CourtSessionBlock InternalCourtSessionBlockID="1615773709"> <StartTime>10:00 AM</StartTime> <EndTime>11:00 AM</EndTime> </CourtSessionBlock> <TimestampCreate>07/14/2016 08:58:23:240</TimestampCreate> </Setting> </Hearing> <Hearing ID="175088128" InternalHearingEventID="1734552992" Op="A"> <HearingType Op="A" Word="OFP">Order for Protection Hearing</HearingType> <HearingTypeBaseCaseCategory>Family</HearingTypeBaseCaseCategory> <TimestampCreate Op="A">07/14/2016 09:00:52:680</TimestampCreate> <Setting ID="25760838" InternalSettingID="1625564129" Date="07/14/2016" Op="A"> <HearingDate Op="A">07/14/2016</HearingDate> <StartTime Op="A">2:00 PM</StartTime> <EndTime Op="A">3:00 PM</EndTime> <CourtSessionName>Ad-Hoc_10-FA-16-40</CourtSessionName> <CourtSessionID Op="A" ID="3862221" InternalCourtSessionID="1612936894"/> <Calendar Op="A" Word="10GEN">New General Carver</Calendar> <CalendarBaseCaseCategory>Criminal</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Civil</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Family</CalendarBaseCaseCategory> <CalendarBaseCaseCategory>Probate or Mental Health</CalendarBaseCaseCategory> <CourtSessionBlock InternalCourtSessionBlockID="1615773710"> <StartTime Op="A">2:00 PM</StartTime> <EndTime Op="A">3:00 PM</EndTime> </CourtSessionBlock> <TimestampCreate Op="A">07/14/2016 09:00:52:767</TimestampCreate> </Setting> </Hearing> </Case> <ProtectionOrder InternalProtectionOrderID="2551" xmlns:user="http://tylertechnologies.com"> <Deleted>false</Deleted> <ProtectionOrderNumber>1600329</ProtectionOrderNumber> <Type Word="EXPARTE">Ex Parte Order for Protection</Type> <Statuses> <Status> <Current>true</Current> <Active>No</Active> <Date>07/14/2016</Date> <Type Word="SUPERSEDED">Superseded</Type> <TimestampCreate>07/14/2016 09:00:25:510</TimestampCreate> </Status> </ProtectionOrder> <ProtectionOrder InternalProtectionOrderID="2552" xmlns:user="http://tylertechnologies.com"> <Deleted>false</Deleted> <ProtectionOrderNumber>1600330</ProtectionOrderNumber> <Type Word="EXPARTE">Ex Parte Order for Protection</Type> <Statuses> <Status> <Current>true</Current> <Active>Yes</Active> <Date>07/14/2016</Date> <Type Word="SBJO">Signed By Judicial Officer</Type> <TimestampCreate>07/14/2016 09:00:25:547</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </Integration>
  5. I have revised my question. I would like to get the Status whose TimstampCreate matches (or closely) ControlPoint Timestamp. How do I do this with my xslt code? My xml code <?xml version="1.0" encoding="UTF-8"?> <Integration> <ControlPoint Timestamp="5/9/2016 2:34:34 PM" UserID="kuku">SAVE</ControlPoint> <ProtectionOrders> <ProtectionOrder Op="E"> <Statuses> <Status> <Date>05/09/2016</Date> <Type Word="DIS">Dismissed</Type> <TimeStampCreate>05/09/2016 14:34:48:633</TimestampCreate> </Status> <Status Op="A"> <Date Op="A">05/09/2016</Date> <Type Op="A" Word="SBJ">Signed</Type> <TimestampCreate>05/09/2016 14:34:34:737</TimestampCreate> </Status> </Statuses> </ProtectionOrder> </Integration> Expected Output something similar to this: <Statuses> <Status Op="A"> <Current>false</Current> <Date Op="A">05/09/2016</Date> <Type Op="A" Word="SBJ">Signed</Type> <TimestampCreate>20160509143434</TimestampCreate> </Status> </Statuses> I have a function to convert date time to numeric. Here is the function <xsl:value-of select=mscef:formatDateTimeNumeric(mscef:fixOdysseyTimestamp(string(TimeStampCreate)))"/> My xslt 1.0 code <xsl:value-of select="/Integration/ProtectionOrder/Statuses/Status/Date"/>
  6. Facing Issue in XSLT format

    Hi Anyone, It will be great if any one can help me to format my xslt in table format. I am given my below xslt and input xml also. Input xml: <?xml version="1.0" encoding="UTF-8"?> <L7j:jdbcQueryResult xmlns:L7j="http://ns.l7tech.com/2012/08/jdbc-query-result"> <L7j:row> <L7j:col name="name" type="java.lang.String">Policy for service #0b8bab6913cc588557b6973e94d1bfdd, WSTrustSoapService</L7j:col> <L7j:col name="comment" ><![CDATA[NULL]]></L7j:col><L7j:col name="version" type="java.lang.Integer">18</L7j:col></L7j:row> <L7j:row><L7j:col name="name" type="java.lang.String">Policy for service #0b8bab6913cc588557b6973e94d5893d, UUPRStub</L7j:col><L7j:col name="comment" ><![CDATA[NULL]]></L7j:col><L7j:col name="version" type="java.lang.Integer">16</L7j:col></L7j:row><L7j:row><L7j:col name="name" type="java.lang.String">Policy for service #0b8bab6913cc588557b6973e94d7900f, smstest</L7j:col><L7j:col name="comment" ><![CDATA[NULL]]></L7j:col><L7j:col name="version" type="java.lang.Integer">6</L7j:col></L7j:row> </L7j:jdbcQueryResult> XSLT Code: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:L7j="http://ns.l7tech.com/2012/08/jdbc-query-result"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>Name</th> <th>Comment</th> <th>Version</th> </tr> <xsl:for-each select="L7j:jdbcQueryResult/L7j:row/L7j:col"> <tr> <xsl:if test="@name ='name'"> <td><xsl:value-of select="."/></td> </xsl:if> <xsl:if test="@name ='comment'"> <td><xsl:value-of select="."/></td> </xsl:if> <xsl:if test="@name ='version'"> <td><xsl:value-of select="."/></td> </xsl:if> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> which give not correct format.. I want the format in below manner Name comment version ---------------------------------------- test test123 23
  7. I have a xml document that I would like to display **Number** from <CrossReferenceNumber> elemen. In my xslt the **Number** is inside <ext:SupersededProtectionOrderID> element. Desired output <ext:SupersededProtectionOrderID>OFP System Number</ext:SupersededProtectionOrderID> Here are the conditions: Condition one If ProtectionOrder/CrossReferenceNumbers/CrossReferenceNumber/Type = ‘OFP System Number’ and ProtectionOrders/ProtectionOrder/Statuses/Status/Type = Signed By Judicial Officer has an Op = “A” Condition two If ProtectionOrder/CrossReferenceNumbers/CrossReferenceNumber/Type = ‘OFP System Number’ and ProtectionOrders/ProtectionOrder/Statuses/Status/Type = ‘Signed By Judicial Officer – Corrected’ and has Op = ‘A’ display ProtectionOrder/CrossReferenceNumbers/CrossReferenceNumber/Number My xml <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="BCA PO Notification" MessageID="67177928" xmlns=""> <ProtectionOrders> <ProtectionOrder Op="E" InternalProtectionOrderID="932"> <ProtectionOrderNumber>201500845</ProtectionOrderNumber> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>Yes</Active> <Date Op="A">09/01/2015</Date> <Type Op="A" Word="SBJO">Signed By Judicial Officer</Type> <TimestampCreate Op="A">09/01/2015 12:39:49:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>No</Active> <Date>09/01/2015</Date> <Type Word="DRAFT">Draft</Type> <TimestampCreate>09/01/2015 12:39:43:207</TimestampCreate> </Status> </Statuses> <CrossReferenceNumbers> <CrossReferenceNumber> <Type Word="NCICNUM">NCIC Number</Type> <Number>Testing123</Number> </CrossReferenceNumber> </CrossReferenceNumbers> <TimestampCreate>09/01/2015 12:39:43:140</TimestampCreate> <TimestampChange>09/01/2015 12:39:49:750</TimestampChange> </ProtectionOrder> </ProtectionOrders> </Case> <ProtectionOrder Op="E" InternalProtectionOrderID="932" xmlns:user="http://tylertechnologies.com"> <ProtectionOrderNumber>201500845</ProtectionOrderNumber> <Type Word="OFP">Order for Protection</Type> <Statuses> <Status Op="A"> <Current>true</Current> <Active>Yes</Active> <Date Op="A">09/01/2015</Date> <Type Op="A" Word="SBJO">Signed By Judicial Officer</Type> <TimestampCreate Op="A">09/01/2015 12:39:49:763</TimestampCreate> </Status> <Status> <Current>false</Current> <Active>No</Active> <Date>09/01/2015</Date> <Type Word="DRAFT">Draft</Type> <TimestampCreate>09/01/2015 12:39:43:207</TimestampCreate> </Status> </Statuses> <CrossReferenceNumbers> <CrossReferenceNumber> <Type Word="NCICNUM">OFP System Number</Type> <Number>Testing123</Number> </CrossReferenceNumber> </CrossReferenceNumbers> </ProtectionOrder> My xslt code <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:exc="http://www.courts.state.mn.us/ProtectionOrderServiceExchange/1.0" xmlns:ext="http://www.courts.state.mn.us/ProtectionOrderExtension/1.0"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template name="ProtectionOrder"> <!--SupersededProtectionOrderID--> <ext:SupersededProtectionOrderID> <xsl:choose> <xsl:when test="(Statuses/Status/Type/@Op='A') and count(CrossReferenceNumbers/CrossReferenceNumber/Type='OFP System Number')>0"> <xsl:value-of select="Number"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="/Integration/ProtectionOrder[@InternalProtectionOrderID=current()/MNProtectionOrderAdditional/@SupersededProtectionOrderID]/ProtectionOrderNumber"/> </xsl:otherwise> </xsl:choose> </ext:SupersededProtectionOrderID> </xsl:template> </xsl:stylesheet>
  8. I would like to count how many Stage=Disposition are there and also how many Stage=Case Filing are there in order to accomplish what the following requirements states. I am not sure how to do this. For each unique ChargeID evaluate the ChargeHistory records. If, Stage=”Disposition Event” is found verify the number of DispositionEventSequence. If only “1” populate Charge Information, otherwise use the highest DispositionEventSequence to populate. If no Stage=”Disposition Event” is found look for Stage=”Case Filing” to populate. If only “1” populate Charge information, otherwise use the highest Case Filing Filing Sequence to populate. XML <Integration xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:tsg="http://tsgweb.com" xmlns:IXML="http://tsgweb.com" xmlns:CMCodeQueryHelper="urn:CMCodeQueryHelper" PackageID="IXML Case Notification Test" MessageID="67078058" xmlns=""> <Case InternalID="1616807927" ID="11747370" xmlns:user="http://tylertechnologies.com"> <Charge ID="10547226" PartyID="16580814" CurrSentenceID="155092098" InternalChargeID="1616447618" InternalPartyID="1614482843" xmlns:reslib="urn:reslib"> <ChargeOffenseDate>03/26/2014</ChargeOffenseDate> <ChargeHistory ChargeHistoryID="41490828" Stage="Case Filing" FilingSequence="1" InternalOffenseHistoryID="1635954993"> <ChargeNumber>1</ChargeNumber> <ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate> <Statute> <StatuteDescription>Traffic Regulations - Failure to obey traffic control device</StatuteDescription> <StatuteCode Word="169064a" InternalCodeID="66247">Traffic Regulations - Failure to obey traffic control device</StatuteCode> <Degree Word="PMD">Petty Misdemeanor</Degree> </Statute> <Additional> <LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation> </Additional> </ChargeHistory> <ChargeHistory ChargeHistoryID="41490828" Stage="Case Filing" FilingSequence="2" InternalOffenseHistoryID="1635954993"> <ChargeNumber>2</ChargeNumber> <ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate> <Statute> <StatuteDescription>Testing Case Filling 2</StatuteDescription> <StatuteCode Word="169064a" InternalCodeID="66247">Testing Case Filing 2</StatuteCode> <Degree Word="PMD">Petty Misdemeanor</Degree> </Statute> <Additional> <LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation> </Additional> </ChargeHistory> <ChargeHistory ChargeHistoryID="41858685" Stage="Disposition Event" DispositionEventSequence="1" CurrentCharge="true" InternalOffenseHistoryID="1636250409"> <ChargeNumber>1</ChargeNumber> <ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate> <Statute> <StatuteDescription>Traffic Regulations - Failure to obey traffic control device</StatuteDescription> <StatuteCode Word="169064a" InternalCodeID="66247">Traffic Regulations - Failure to obey traffic control device</StatuteCode> <Degree Word="PMD">Petty Misdemeanor</Degree> </Statute> <Additional> <LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation> </Additional> </ChargeHistory> <ChargeHistory ChargeHistoryID="41858685" Stage="Disposition Event" DispositionEventSequence="2" CurrentCharge="true" InternalOffenseHistoryID="1636250409"> <ChargeNumber>2</ChargeNumber> <ChargeOffenseDate deprecated="true">03/26/2014</ChargeOffenseDate> <Statute> <StatuteDescription>Testing second disposition number 2</StatuteDescription> <Degree Word="PMD">Petty Misdemeanor</Degree> </Statute> <Additional> <LocationOfViolation>Hwy 15 & Century Ave</LocationOfViolation> </Additional> </ChargeHistory> </Charge> </Case></Integration> Xslt <xsl:template name="Charge"> <ext:Charge> <xsl:choose> <xsl:when test="(count(ChargeHistory[@Stage='Disposition Event']))>0"> <j:ChargeSequenceID> <xsl:value-of select="ChargeNumber"/> </j:ChargeSequenceID> <j:ChargeStatute> <j:StatuteDescriptionText> <xsl:value-of select="Statute/StatuteCode"/> </j:StatuteDescriptionText> <j:StatuteText> <xsl:value-of select="Statute/StatuteCode/@Word"/> </j:StatuteText> </j:ChargeStatute> <j:ChargeSeverityDescriptionText> <xsl:value-of select="Statute/Degree"/> </j:ChargeSeverityDescriptionText> </xsl:when> <xsl:otherwise></xsl:otherwise> </xsl:choose> </ext:Charge></xsl:template>
  9. I would like to show address in one line. How do I do this? My code is only showing this: <nc:StreetFullText>607 Main St W</nc:StreetFullText> I know I need to add 'City', 'State', 'Zip' to the end of my line of code so that the City, State and Zip is added but I do not know how to do it. AssociatedValue[@type='Street1']/Text Desired output <nc:StreetFullText>607 Main St W, New York, DC 77777</nc:StreetFullText> My xml <EnumerationValue code="DC042015J"><AssociatedValue type="Street1"><Text>607 Main St W</Text></AssociatedValue><AssociatedValue type="City"><Text>New York</Text></AssociatedValue><AssociatedValue type="State"><Text>MN</Text></AssociatedValue><AssociatedValue type="Zip"><Text>77777</Text></AssociatedValue></EnumerationValue><EnumerationValue code="DC046015J"> Xslt code <nc:StreetFullText><xsl:variable name="vCourtORI"><xsl:value-of select="/Integration/Case/Court/CourtNCIC"/></xsl:variable><xsl:value-of select="document(concat($gEnvPath,'SchemasCourtXMLSimpleTypesCourtLocationTextType.xml'))/SimpleTypeCompanion/EnumerationValue[@code=$vCourtORI]/AssociatedValue[@type='Street1']/Text"/></nc:StreetFullText>
  10. Hello, I am printing a reports, My problem is that i jump to next page in 2 situations. 1. number of rows in page exceeded the number that the user set. 2. When we handle another customer.(All the customers are in the same XML) And we don't want that customer A will see transactions of customer B.(we give the reports to the customers) Jumping to new page because of 2 reasons cause me a problem that sometimes at the beginning of the page i jump to new page because position()%RowsInPage = 0.. I attached the customer report XSL file. Oz
  11. Transform Flat Format to Hierarchical

    I have a situation that is well over my head. I need to take a flat layout and transform it into a hierarchical layout. (See attachments) I actually have a prototype XSLT that uses named templates and having one template call the other to create somewhat of the hierarchy. Currently, the structures are repeating. I need to know how not to have them repeat. I also can't get my head around how to find and extract the complete content at the correct place. I would have posted my XSLT, but, I may be headed in completely the wrong direction. What I'd like is to get proper guidance on how to do it. I suspect I'll have to learn about muenchian grouping, but still have no idea how to proceed. I'm also limited to XSLT 1.0. SampleCustomerSalesHierarchical.xml SampleCustomerSalesFlat.xml
  12. A Newbie needs help in XSLT/XPATH

    Hi guys! I'm having a problem that it's driving me crazy. It must be simple for most of you, but for me it has been a nightmare. Basically, I need to clean up the namespaces in a XML file for a more friendly reading. I am learning to use XSLT for that, but I am not understanding how to apply the correct XPATH sentence in the XSLT. The original XML file looks like that: <?xml version="1.0" encoding="utf-16"?><cResultado xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Servicos xmlns="http://tempuri.org/"> <cServico> <Codigo>40010</Codigo> <PrazoEntrega>1</PrazoEntrega> <EntregaDomiciliar>S</EntregaDomiciliar> <EntregaSabado>S</EntregaSabado> <Erro /> <MsgErro /> <obsFim /> </cServico> <cServico> <Codigo>50020</Codigo> <PrazoEntrega>3</PrazoEntrega> <EntregaDomiciliar>S</EntregaDomiciliar> <EntregaSabado>S</EntregaSabado> <Erro /> <MsgErro>TESTE</MsgErro> <obsFim /> </cServico> </Servicos></cResultado> I would like to transform it on that: <?xml version="1.0" encoding="utf-16"?><cResultado> <Servicos> <cServico> <Codigo>40010</Codigo> <PrazoEntrega>1</PrazoEntrega> <EntregaDomiciliar>S</EntregaDomiciliar> <EntregaSabado>S</EntregaSabado> <Erro /> <MsgErro /> <obsFim /> </cServico> <cServico> <Codigo>50020</Codigo> <PrazoEntrega>3</PrazoEntrega> <EntregaDomiciliar>S</EntregaDomiciliar> <EntregaSabado>S</EntregaSabado> <Erro /> <MsgErro>TESTE</MsgErro> <obsFim /> </cServico> </Servicos></cResultado> I am using this XSLT to produce the desired XML file, but It doesn't work: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" ><xsl:output method="xml" indent="yes"/><xsl:template match="/"> <Servicos> <xsl:for-each select="//*[local-name() = 'cServico']"> <cServico> <Codigo><xsl:value-of select="Codigo"/></Codigo> <PrazoEntrega><xsl:value-of select="PrazoEntrega"/></PrazoEntrega> <EntregaDomiciliar><xsl:value-of select="EntregaDomiciliar"/></EntregaDomiciliar> <EntregaSabado><xsl:value-of select="EntregaSabado"/></EntregaSabado> <Erro><xsl:value-of select="Erro"/></Erro> <MsgErro><xsl:value-of select="MsgErro"/></MsgErro> <obsFim><xsl:value-of select="obsFim"/></obsFim> </cServico> </xsl:for-each> </Servicos> </xsl:template></xsl:stylesheet> Probably I am not using the correct XPATH sentence in the XSLT because of the namespaces. Could you help with that? Thanks, Euler Almeida
  13. Below is the XML : How to replace the nodes in XML based on attribute using xslt. <?xml version="1.0" encoding="UTF-8"?><DST><CDGCreateTree><DST><currentJobName>PQContactComplete</currentJobName><AWD><case><transaction><UIID>Test</UIID></transaction></case><case><transaction><UIID>Testsample</UIID></transaction></case></AWD></DST></CDGCreateTree><newNode><transaction relate="Y" id="1"/></newNode></DST> 1)In above xml total 2 cases which is having individual transactions2)newNode node contains another transaction with ID(id = "1") 3)My requirement is like i want to replace first case transaction with newNode transaction which is generated basedon first case transaction only, That is the reason why i am looking into remove unnecessary data. 4)For every operation newNode contains only one transaction. Result should be: <?xml version="1.0" encoding="UTF-8"?><DST><CDGCreateTree><DST><currentJobName>PQContactComplete</currentJobName><AWD><case><transaction relate="Y" id="1"/></case><case><transaction><UIID>Testsample</UIID></transaction></case></AWD></DST></CDGCreateTree></DST> In future I may get another transaction with id under newNode node below is the xml <?xml version="1.0" encoding="UTF-8"?><DST><CDGCreateTree><DST><currentJobName>PQContactComplete</currentJobName><AWD><case><transaction relate="Y" id="1"/></case><case><transaction><UIID>Testsample</UIID></transaction></case></AWD></DST></CDGCreateTree><newNode><transaction relate="Y" id="2"/></newNode></DST> This time I should replace second case transaction with newNode transaction(becasue first case transaction already replaced with newNode transaction and it contains id value)like that I want continue the process. Finally Expected result: <?xml version="1.0" encoding="UTF-8"?><DST><CDGCreateTree><DST><currentJobName>PQContactComplete</currentJobName><AWD><case><transaction relate="Y" id="1"/></case><case><transaction relate="Y" id="2"/></case></AWD></DST></CDGCreateTree></DST> I have used below xslt, but it's not helped me, Can any one please suggest me or correct me. <?xml version="1.0"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version = "1.0"> <xsl:template match="@* | node()"><xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy></xsl:template> <xsl:variable name="targetNode" select="//newNode/transaction"/> <xsl:template match="(//transaction[ancestor::*[name() = "CDGCreateTree"]][not(@id)])[1]"><xsl:copy-of select="$targetNode"/></xsl:template></xsl:stylesheet> Explaination of Above XSL: (//transaction[ancestor::*[name() = 'CDGCreateTree']][not(@id)])[1] this statement is defines about case transaction which is not having id and first transaction replace with (//newNode/transaction) New transaction. In future if i get any newNode transaction it should be replace accordingly to above xsl,i thought it will work as per the statemnt but some thing is missed please suggest me.
  14. XSLT simple exam question

    I need your help for a question about XSLT. It is part of my preparation for an exam. The information given is as follows: HTML rendering of the XML document from Figure 1. Note that groups, and staff within each group, appear in the same order as in the XML document. At the end of each staff member entry, there are the identifiers of other groups to which the academic also belongs. These are hyperlinked to the start of the corresponding group sections. The final result of applying XSLT must be as shown in the attached picture. The XML file is as follows: <?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="research.xsl"?><ResearchGroups xmlns="http://www.essex.ac.uk/ce832"><Group name="Intelligent Systems Group" id="ISG"> The IntelligentSystems Group pursues internationally-leading research in a widerange of intelligent systems. </Group><Group name="Robotics" id="RBT"> The Essex robotics group is one ofthe largest mobile robotics groups in the UK. </Group><Staff name="Callaghan, Vic" title="Professor" groups="ISG RBT">Intelligent environments and robotics. </Staff><Staff name="Gu, Dongbing" title="Dr" groups="RBT"> Multi-agentand distributed control systems. </Staff></ResearchGroups> The .xsl file I have created is as follows: <xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:rg="http://www.essex.ac.uk/ce832"xmlns="http://wwww.w3.org/1999/xhtml"version="2.0"><xsl:template match="/"><html><head> <title>Research Groups</title> </head><body> <xsl:apply-templates select="//rg:Group"/> </body></html></xsl:template><xsl:template match="rg:Group"><xsl:variable name="ID" select="@id"/><h3> <a name="{$ID}"> <xsl:value-of select="@name"/> </a> </h3><p> <xsl:value-of select="text()"/> </p> <xsl:for-each select="//rg:Staff"> <xsl:variable name="string" select="@groups" /> <xsl:value-of select="$string" /> <xsl:variable name="stringList" select="tokenize($string, ' ')" /> <xsl:variable name="staffName" select="@name" /> <xsl:variable name="description" select="text()" /> <xsl:for-each select="$stringList"> <xsl:variable name="item" select="." /> <xsl:choose> <xsl:when test="matches($item, $ID)"> <ul> <li> <xsl:value-of select="$staffName" />: <xsl:value-of select="$description" /> <xsl:value-of select="$ID" /> </li> </ul> </xsl:when> </xsl:choose> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> The problem I have is with the part "At the end of each staff member entry, there are the identifiers of other groups to which the academic also belongs. These are hyperlinked to the start of the corresponding group sections." Because the first staff member belongs to two groups while the second does not. At the moment, the information displayed is the id of the current group, not as expected. The first person belongs to who groups - ISG and RBT. When their name appears in the first group, the id of the other group must be displayed and to contain link to the second group - Robotics. The same applies if the person appears in the second group. If the person does not belong to more than one group, there does not have to be a link displayed. I guess that I have to take each value from the stringList variable and make a comparison. The problem is that I do not know how to do it. I hope that somebody can help me! Thank you in advance.
  15. I'm in the final stretch of this project. It 1) takes data from a server-side SQL database using php; 2) generates and saves a xml file to the server; and 3) uses a xsl transform and word template document along with the previously generated xml file to generate a word 2010 document which is pushed out to the client. I've been able to get the word document working just fine for all of the text fields but am having trouble with the checkbox. I want to be able to check or leave un-checked a checkbox in the word template document based upon a value in the xml file. The relevant xslt code section is: <w:checkBox><w:sizeAuto/><w:default w:val="0"/></w:checkBox> If I could change the default "val" from "0" to "1" based upon the content of the xml file, that would make the change I'm looking for. I've already written code to create a "0" or "1" in the relevant location on my xml file. All I need to know is how to change the xsl transform code based upon a "0" or "1" value in the xml file. Any suggestions would be welcomed.
  16. I have a XSD that looks something like this: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.02"> <xs:include schemaLocation="Basic_Types.xsd"/> <xs:element name="MyElement"> <xs:complexType mixed="true"> <xs:sequence> <xs:element name="data"> <xs:complexType> <xs:sequence> <xs:element name="timeStamp" type="specialtime"/> <xs:element name="DeviceClass"> <xs:complexType> <xs:sequence> <xs:element name="MaxAmount" type="Amount"/> <xs:element name="MaxVolume" type="Volume"/> </xs:sequence> <xs:attribute name="Type" type="Type" use="required" fixed="FP"/> <xs:attribute name="DeviceID" type="DeviceID" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="ApplicationSender" type="ApplicationSender" use="required"/> <xs:attribute name="WorkstationID" type="WorkstationID" use="required"/> </xs:complexType> </xs:element> </xs:schema> I want to change it to look something like this: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.02"> <xs:include schemaLocation="Basic_Types.xsd"/> <xs:complexType name="DeviceClass"> <xs:sequence> <xs:element name="MaxAmount" type="Amount"/> <xs:element name="MaxVolume" type="Volume"/> </xs:sequence> <xs:attribute name="Type" type="Type" use="required" fixed="FP"/> <xs:attribute name="DeviceID" type="DeviceID" use="required"/> </xs:complexType> <xs:complexType name="data"> <xs:sequence> <xs:element name="timeStamp" type="specialtime"/> <xs:element name="DeviceClass" type ="DeviceClass"/> </xs:sequence> </xs:complexType> <xs:complexType mixed ="true" name ="MyElement"> <xs:sequence> <xs:element name="data" type ="data"> </xs:element> </xs:sequence> <xs:attribute name="ApplicationSender" type="ApplicationSender" use="required"/> <xs:attribute name="WorkstationID" type="WorkstationID
  17. Hi thereI'm not a programmer, but need some help to find a way of displaying text in the CDATA section of an XML file using XSL. Or if there is an alternative to using XSL then I'm all ears (eyes?). Take, for example, the following line of my XML file: <property id="instruction1" media="screen"><![CDATA[<p>Select the <span class="bold">option</span> you think is correct.</p>]]></property> I ONLY want to display the text between the 'p' tags, i.e. "Select the option you think is correct." The formatting 'span' tag can be included if necessary, just as long as the 'p' tags are not displayed. Is this possible? Edit: I should clarify that I would like to create an XSL to use to display the XML content in a browser window. The full XML file is attached if required. Thanks a lotNiall 01_01_005.xml
  18. MOAR HELPERS!

    HELPERS IN THE XML THREADS!!!!!!!
  19. xml into xslt

    I want to change my xml file into xsl so that it can fit into my chart, I am trying to put it into ascending form… This is my .xml<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="banks.xsl"?> <chart caption='Banks' xAxisName='Bank Types' yAxisName='Amount' numberPrefix='$' showValues='0'> <set label='UOB' value='420000' /> <set label='UOB' value='910000' /> <set label='DBS' value='720000' /> <set label='OCBC' value='550000' /> <set label='UOB' value='810000' /> <set label='DBS' value='510000' /> <set label='OCBC' value='680000' /> <set label='UOB' value='620000' /> <set label='DBS' value='610000' /> <set label='OCBC' value='490000' /> <set label='OCBC' value='530000' /> <set label='DBS' value='330000' /> <styles> <definition> <style name='CanvasAnim' type='animation' param='_xScale' start= '0' duration='1' /> </definition> <application> <apply toObject='Canvas' styles='CanvasAnim' /> </application> </styles> </chart> And this is my .xsl file <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="chart"> <xsl:apply-templates select="label"> <xsl:sort order="ascending" /> </xsl:apply-templates> </xsl:template> </xsl:stylesheet> I had another try: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output indent="yes"/><xsl:strip-space elements="*"/><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"><xsl:sort select="@value"/></xsl:apply-templates></xsl:copy></xsl:template></xsl:stylesheet> But both cannot work... please help me... Thank you!!!
  20. xml into xslt

    I want to change my xml file into xsl so that it can fit into my chart, I am trying to put it into ascending form… This is my .xml<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="banks.xsl"?> <chart caption='Banks' xAxisName='Bank Types' yAxisName='Amount' numberPrefix='$' showValues='0'> <set label='UOB' value='420000' /> <set label='UOB' value='910000' /> <set label='DBS' value='720000' /> <set label='OCBC' value='550000' /> <set label='UOB' value='810000' /> <set label='DBS' value='510000' /> <set label='OCBC' value='680000' /> <set label='UOB' value='620000' /> <set label='DBS' value='610000' /> <set label='OCBC' value='490000' /> <set label='OCBC' value='530000' /> <set label='DBS' value='330000' /> <styles> <definition> <style name='CanvasAnim' type='animation' param='_xScale' start= '0' duration='1' /> </definition> <application> <apply toObject='Canvas' styles='CanvasAnim' /> </application> </styles> </chart> And this is my .xsl file <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="chart"> <xsl:apply-templates select="label"> <xsl:sort order="ascending" /> </xsl:apply-templates> </xsl:template> </xsl:stylesheet> I had another try: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><xsl:output indent="yes"/><xsl:strip-space elements="*"/><xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"><xsl:sort select="@value"/></xsl:apply-templates></xsl:copy></xsl:template></xsl:stylesheet> But both cannot work... please help me... Thank you!!!
  21. -I am generating image gallery that suports different types of containers. ie 33% container,50%container and 100 % container. -if container is of type 33% percent then three containers will come in one row separated by verticle line and margin. I want to remove left margin of first container and right margin last container.-if container is of type 50% percent then two containers will come in one row separated by verticle line and margin. I want to remove left margin of first container and right margin other container. -if container is of type 100% percent then only one container is there and no need to remove margin.-Issue is that when multiple containers of this types are present in image gallery in any sequence then how predict which containers rignt margin and line separator has to remove. how to do this? following is xsl file: <xsl:when test="intLayoutType = 219"> <xsl:if test="intNum4 = 2"> <![CDATA[<div class=three_column]]> <xsl:if test="position() = 1"> <![CDATA[style=margin-left: 0px]]> </xsl:if> <xsl:if test="position() = last()"> <![CDATA[style=margin-right: 0px; border-right:none]]> </xsl:if> <xsl:if test="preceding-sibling::intNum4[1]=2 and preceding-sibling::intNum4[2]=2"> <![CDATA[style=margin-right: 0px; border-right:none]]> </xsl:if> <![CDATA[>]]> </xsl:if> <xsl:if test="intNum4 = 1"> <![CDATA[<div class=two_column]]> <xsl:if test="position() = 1"> <![CDATA[style=margin-left: 0px]]> </xsl:if> <xsl:if test="position() = last() "> <![CDATA[style=margin-right: 0px; border-right: none]]> </xsl:if> <xsl:if test="position() mod 2 = 0"> <![CDATA[style=margin-right: 0px; border-right: none]]> </xsl:if> <![CDATA[>]]> </xsl:if> <xsl:if test="intNum4 = 0"> <![CDATA[<div class="one_column">]]> </xsl:if> <WD:ContentController MenuPosition="Content" ResourceFamily="CNT" runat="server"> <xsl:attribute name="contentId"> <xsl:value-of select="autContentId"/> </xsl:attribute> <ContentTemplate> <!--for 33% container and 50% container--> <xsl:if test="intNum4 = 2 or intNum4 = 1"> <![CDATA[<div class="gallery_margin_right">]]> <xsl:if test="string-length(vchTitle) > 0"> <![CDATA[<h1 class="gallery_title">]]> <xsl:value-of select="vchTitle" /> <![CDATA[</h1>]]> </xsl:if> <!--Website display--> <xsl:if test="string-length(vchImageUrl1) > 0"> <![CDATA[<asp:Image runat=server" class="gallery_img" ImageUrl=]]><xsl:value-of select="vchImageUrl1" /> <![CDATA[" ToolTip="]]><xsl:value-of select="vchImageAltText1" /> <![CDATA[" AlternateText="]]><xsl:value-of select="vchImageAltText1" /> <![CDATA[" />]]> </xsl:if> <!--<div> <xsl:value-of select="vchTxt1" /> </div>--> <![CDATA[<div class="gallery_description">]]><xsl:value-of select="vchTxt1" /> <![CDATA[</div>]]> <xsl:if test="string-length(vchTxt4) > 0"> <![CDATA[<p class="gallery_plink">]]> <![CDATA[<asp:HyperLink runat=server" class="gallery_link" Text=]]><xsl:value-of select="vchTxt4" /> <![CDATA[" NavigateUrl="]]><xsl:value-of select="vchTxt6" /> <![CDATA[" ToolTip="]]><xsl:value-of select="vchTxt5" /> <![CDATA[" Target="]]><xsl:value-of select="vchTxt9" /> <![CDATA[" />]]> <![CDATA[</p>]]> </xsl:if> <xsl:if test="string-length(vchAscxTagName) > 0"> <![CDATA[<wd:]]><xsl:value-of select="vchAscxTagName" /><![CDATA[ id=imageStrip" class="gallery_imageStrip" runat="server" ContentId=]]><xsl:value-of select="autContentId" /><![CDATA[" />]]> </xsl:if> <![CDATA[</div>]]> </xsl:if> <!--for 100 % container--> <xsl:if test="intNum4 = 0"> <!--Website display--> <![CDATA[<div style="clear: both;">]]> <![CDATA[</div>]]> <![CDATA[<div>]]> <xsl:if test="string-length(vchImageUrl1) > 0"> <![CDATA[<div class="gallery_imgalign_one_column">]]> <![CDATA[<asp:Image runat=server" class="gallery_img" ImageUrl=]]><xsl:value-of select="vchImageUrl1" /> <![CDATA[" ToolTip="]]><xsl:value-of select="vchImageAltText1" /> <![CDATA[" AlternateText="]]><xsl:value-of select="vchImageAltText1" /> <![CDATA[" />]]> <![CDATA[</div>]]> </xsl:if> <![CDATA[<div class="gallery_one_column">]]> <xsl:if test="string-length(vchTitle) > 0"> <![CDATA[<h1 class="gallery_title_one_column">]]> <xsl:value-of select="vchTitle" /> <![CDATA[</h1>]]> </xsl:if> <![CDATA[<div class="gallery_description_one_column">]]><xsl:value-of select="vchTxt1" /> <![CDATA[</div>]]> <xsl:if test="string-length(vchTxt4) > 0"> <![CDATA[<p class="gallery_plink_one_column">]]> <![CDATA[<asp:HyperLink runat=server" class="gallery_link" Text=]]><xsl:value-of select="vchTxt4" /> <![CDATA[" NavigateUrl="]]><xsl:value-of select="vchTxt6" /> <![CDATA[" ToolTip="]]><xsl:value-of select="vchTxt5" /> <![CDATA[" Target="]]><xsl:value-of select="vchTxt9" /> <![CDATA[" />]]> <![CDATA[</p>]]> </xsl:if> <xsl:if test="string-length(vchAscxTagName) > 0"> <![CDATA[<wd:]]><xsl:value-of select="vchAscxTagName" /><![CDATA[ id=imageStrip" class="gallery_imageStrip" runat="server" ContentId=]]><xsl:value-of select="autContentId" /><![CDATA[" />]]> </xsl:if> <![CDATA[</div>]]> <![CDATA[</div>]]> </xsl:if> </ContentTemplate> </WD:ContentController> <xsl:if test="intNum4 = 0 or intNum4 = 1 or intNum4 = 2"> <![CDATA[</div>]]> </xsl:if> </xsl:when>
  22. Migration of pages

    Hi All, We are designing amobile application based on Oracle Siebel. We are stuck on mobile build. We are facing the problem on navigating from first html page to another.Actually what is happening in Vanilla Object Manager 'Siebel Self Service Wireless (ENU)' is after login page only one html page is defined which is Main page/Dashboard page. But in our mobile build wireframe, it has two html pages after login. But in tools at application level, we define only 'acknowledgement page' which is Main Page and its corresponding .swt and .xsl file.So our problem is to figure out how it will navigate from main page to next html page and to subsequent pages after that. Any help in this matter would be highly appreciated.
  23. XML-Exam: Some questions

    Hi everybody, I'm having an XML exam tomorrow and there are still some points which I don't really understand. Appreciate if you could help me understand... Ok No. 1) Regarding the attached XML-Document: What is the result following Address? //md:annotationBody//md:contents[contains(@id, "1")] or //md:annotationBody//md:contents[contains(@id, "2")] My answer was: delivers each element of md:contents which has a 1 or 2 in its id. But the correct answer is: "true" - because with the 'or' the whole expression becomes a predicate. Can someone please explain this for me? I don't really understand the above explenation. No. 2) What is the result of following XQuery? xquery version "1.0";declare namespace xsi = "...."declare default element namespace "Anootation";element root { for %V1 in doc(*./MADCOW.xml*)//textContent[containts(.,"Annotation")] return element A {%V1/../@id}} The answer is: <root xmlns="Annotation"> <A id="1"/> <A id="2"/> </root> But why?? No. 3) Sketch a transformation which returns following information: name of author (author), Title (title) and last content of text (textContent): <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:md="Annotation"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <root> <xsl:apply-templates select="//md:metadata/md:author" /> <xsl:apply-templates select="//md:metadata/title" /> <xsl:apply-templates select="//md:textContent[last()]" /> </root> </xsl:template> <xsl:template match="md:author" > <autor> <xsl:value-of select="."/> </autor> </xsl:template> <xsl:template match="title" > <title> <xsl:value-of select="." /> </title> </xsl:template> <xsl:template match="md:textContent" > <content> <xsl:value-of select="." /> </content> </xsl:template></xsl:stylesheet> Isn't there a simpler way? I don't really understand what it does in line 8 to 14 I'll add other question when they occur. Thank you in advance for your support. Kind regards Mufasa
  24. Web Dev Tool Discussion

    First of all, i am particularly focusing on the cross-reference across files feature. What is it? Simply say, it is like writing Java in Eclipse or Netbeans: When we "dot" a class, a pull down list of member variables show up. When we "ctrl + click" on a usage (of a variable, of a class, of a method, etc), it jumps to the definition of it. I particularly see this feature very helpful, especially when our project goes huge. If we don't need the benefits from this feature, why not use the free and quick editor - Notepad++ ? Many PHP dev tools are equipped with the reference feature. But not many of them can do it across different files. (means in case the definition occurs in a different file of usage.) While I was finding such a (free) IDE which can do this, I heard people keep saying the Eclipse PDT cannot reference across files. Until today, I give it a try. And surprisingly, Eclipse can do it! With the following code snippets: Car.php <?phpclass Car { public function get_type() { return $this->type; // reference OK } public $type = 'ferrari';}class Engine { public function running_in() { // in same file $car = new Car(); // of course this can ref Car echo $car->get_type(); // of course this ok too return $car->type; // of course this ok as well }}?> Driver.php <?php//include 'Car.php'; // works even without include$car = new Car(); // reference OKecho $car->get_type(); // reference OKecho $car->type; // reference OK?> Although this is a good news. Yet I still want to know why people says Eclipse PDT cannot reference across files? Is there any misunderstandings, that I am implementing it wrongly? Also, as many people say, Eclipse is slow because it is Java based. I am ok with the speed. But I still want a comparison list of features of different Web Dev IDE. Thanks for any input about Web Dev Tool discussion! P.S. In addition, JavaScipt list of methods with browser supporting versions (like what Aptana has) would be a very nice feature too!
  25. Will XSL be hacked?

    In my webpage, I am going allow clients (X)HTML. To avoid XSS, I will use HTML Purifier, and disable the <script> tag (and some other dangerous tags). Yet I would like to enable designers of those (X)HTML to use certain programming-like features, for example displaying a list of items, which would need a for-loop. Then I came up with the idea that : users submit the XSL code, I provide the XML with the data required by the users. As HTML Purifier cannot sanitise XSL code (can it?), my proposed flow would be: [*]User submits a piece of XSL code.[*]In the server, there are some sample data (sample XMLs). PHP is used to do the XSL transform with those sample XML data.[*]Pass the output XHTML to HTML Purifier. If HTML Purifier detects any prohibited elements in the code, stop process and show the errors to user.[*]If it passes HTML Purifier, check it against the W3C validator. (This is just a double check. Outputs from HTML Purifier should be valid.)[*]Save the piece of XSL code into database. Use (include) it whenever needed. Do you think the flow above can assure the final XSL code saved into the database is clean (given that HTML Purifier is perfect)? Another concern is that, (this is the main question here), is it safe to accept arbitrary XSL codes, and perform XSL transform by PHP in the server? Could there be any security holes that some XSS, injection, etc being included in the XSL codes, such that being harmful to the server or the PHP programs? Finally, if there are any other ideas/design to achieve this, any solutions are welcomed! Thanks a lot!
×