Jump to content

michaelloveusa

Members
  • Posts

    8
  • Joined

  • Last visited

michaelloveusa's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I figured it out. The key is to create a nested for-each-group and select the current-group() and group by whatever makes your next desired elements unique. Here is my xsl: <?xml version="1.0" encoding="UTF-8" ?><?oracle-xsl-mapper <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. --> <mapSources> <source type="WSDL"> <schema location="../AccelaHearingData.wsdl"/> <rootElement name="AccelaHearingDataOutputCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/AccelaHearingData"/> </source> </mapSources> <mapTargets> <target type="WSDL"> <schema location="../HearingDataService.wsdl"/> <rootElement name="GetHearingDataResponse" namespace="http://www.denvergov.org/HearingDataService"/> </target> </mapTargets> <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.7.0(build 130301.0647.0008) AT [THU MAY 08 21:32:46 MDT 2014]. -->?><xsl:stylesheet version="2.0" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue" xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath" xmlns:ns0="http://www.denvergov.org/HearingDataService" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:med="http://schemas.oracle.com/mediator/xpath" xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/AccelaIntegration/GetHearingData/AccelaHearingData" xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions" xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk" xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/AccelaHearingData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" exclude-result-prefixes="xsi xsl tns plt db xsd wsdl ns0 bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref ora socket ldap"> <xsl:template match="/"> <ns0:GetHearingDataResponse> <xsl:for-each-group select="/db:AccelaHearingDataOutputCollection/db:AccelaHearingDataOutput" group-by="./db:COMBINEDKEY"> <xsl:variable name="currentRow" select="current()"/> <ns0:HearingResponseDetail> <ns0:BusinessName> <xsl:value-of select="$currentRow/db:BUSINESSNAME"/> </ns0:BusinessName> <ns0:TradeName> <xsl:value-of select="$currentRow/db:TRADE_NAME"/> </ns0:TradeName> <ns0:BusinessAdddress> <xsl:value-of select="$currentRow/db:B1_FULL_ADDRESS"/> </ns0:BusinessAdddress> <ns0:City> <xsl:value-of select="$currentRow/db:B1_SITUS_CITY"/> </ns0:City> <ns0:State> <xsl:value-of select="$currentRow/db:B1_SITUS_STATE"/> </ns0:State> <ns0:HearingDate> <xsl:value-of select="$currentRow/db:HEARINGDATE"/> </ns0:HearingDate> <ns0:HearingTime> <xsl:value-of select="$currentRow/db:HEARINGTIME"/> </ns0:HearingTime> <ns0:Outcome> <xsl:value-of select="$currentRow/db:STATUS"/> </ns0:Outcome> <ns0:B1_Per_Group> <xsl:value-of select="$currentRow/db:B1_PER_GROUP"/> </ns0:B1_Per_Group> <ns0:B1_Per_Type> <xsl:value-of select="$currentRow/db:B1_PER_TYPE"/> </ns0:B1_Per_Type> <ns0:B1_Per_Sub_Type> <xsl:value-of select="$currentRow/db:B1_PER_SUB_TYPE"/> </ns0:B1_Per_Sub_Type> <ns0:B1_Per_Category> <xsl:value-of select="$currentRow/db:B1_PER_CATEGORY"/> </ns0:B1_Per_Category> <ns0:ApplicationDate> <xsl:value-of select="$currentRow/db:APPLICATION_DATE"/> </ns0:ApplicationDate> <ns0:Owners> <xsl:for-each-group select="current-group()" group-by="./db:OwnerIndex"> <xsl:variable name="ownerRow" select="current()"/> <ns0:Owner> <ns0:Name> <xsl:value-of select="$ownerRow/db:OWNERNAME"/> </ns0:Name> <ns0:Title> <xsl:value-of select="$ownerRow/db:OWNERTITLE"/> </ns0:Title> </ns0:Owner> </xsl:for-each-group> </ns0:Owners> <ns0:CombinedLicenseDetails> <xsl:for-each-group select="current-group()" group-by="./db:LICENSETYPE"> <xsl:variable name="licenseRow" select="current()"/> <ns0:LicenseType> <xsl:value-of select="$licenseRow/db:LICENSETYPE"/> </ns0:LicenseType> </xsl:for-each-group> </ns0:CombinedLicenseDetails> </ns0:HearingResponseDetail> </xsl:for-each-group> </ns0:GetHearingDataResponse> </xsl:template></xsl:stylesheet>
  2. Hi there - I am struggling with a translation associated with data that I am getting back from a relational database. Basically, I have some outer joins that are creating "extra" rows with the same data. It is hearing-related data that can have 0 to many owners (Owner Index, Name and Title) and 0 to many LICENSETYPE elements. Each of the AccelaHearingDataOutput elements represents a row from a database query. I have created some combined keys to allow grouping. Look at the business name and that will be the base hearing data. And yes, this is from Colorado! :-) Here is the source data and look below for the expected result: <AccelaHearingDataOutputCollection> <AccelaHearingDataOutput><BUSINESSNAME>Retail Marijuana Test</BUSINESSNAME><B1_FULL_ADDRESS>2443 S High St</B1_FULL_ADDRESS><B1_SITUS_CITY>Denver</B1_SITUS_CITY><B1_SITUS_STATE>CO</B1_SITUS_STATE><HEARINGDATE>05/20/2014</HEARINGDATE><HEARINGTIME>15:00</HEARINGTIME><STATUS>Pending</STATUS><TRADE_NAME>Merry Marijuana Store</TRADE_NAME><B1_PER_GROUP>Licenses</B1_PER_GROUP><B1_PER_TYPE>Business</B1_PER_TYPE><B1_PER_SUB_TYPE>Retail Marijuana Store</B1_PER_SUB_TYPE><B1_PER_CATEGORY>NA</B1_PER_CATEGORY><APPLICATION_DATE>2014-04-23T00:00:00.000-06:00</APPLICATION_DATE><OwnerIndex>1</OwnerIndex><OWNERNAME>Test Owner 1</OWNERNAME><OWNERTITLE>Owner 1</OWNERTITLE><LICENSETYPE/><OWNERCOMBINEDKEY>Retail Marijuana Test05/20/201415:001Test Owner 1Owner 1</OWNERCOMBINEDKEY><COMBINEDKEY>Retail Marijuana Test05/20/201415:00</COMBINEDKEY></AccelaHearingDataOutput><AccelaHearingDataOutput><BUSINESSNAME>Retail Marijuana Test</BUSINESSNAME><B1_FULL_ADDRESS>2443 S High St</B1_FULL_ADDRESS><B1_SITUS_CITY>Denver</B1_SITUS_CITY><B1_SITUS_STATE>CO</B1_SITUS_STATE><HEARINGDATE>05/20/2014</HEARINGDATE><HEARINGTIME>15:00</HEARINGTIME><STATUS>Pending</STATUS><TRADE_NAME>Merry Marijuana Store</TRADE_NAME><B1_PER_GROUP>Licenses</B1_PER_GROUP><B1_PER_TYPE>Business</B1_PER_TYPE><B1_PER_SUB_TYPE>Retail Marijuana Store</B1_PER_SUB_TYPE><B1_PER_CATEGORY>NA</B1_PER_CATEGORY><APPLICATION_DATE>2014-04-23T00:00:00.000-06:00</APPLICATION_DATE><OwnerIndex>3</OwnerIndex><OWNERNAME>Test Owner 3</OWNERNAME><OWNERTITLE>Owner 3</OWNERTITLE><LICENSETYPE/><OWNERCOMBINEDKEY>Retail Marijuana Test05/20/201415:003Test Owner 3Owner 3</OWNERCOMBINEDKEY><COMBINEDKEY>Retail Marijuana Test05/20/201415:00</COMBINEDKEY></AccelaHearingDataOutput><AccelaHearingDataOutput><BUSINESSNAME>test combined license for Mike</BUSINESSNAME><B1_FULL_ADDRESS>201 E Colfax Ave</B1_FULL_ADDRESS><B1_SITUS_CITY>Denver</B1_SITUS_CITY><B1_SITUS_STATE>CO</B1_SITUS_STATE><HEARINGDATE>05/08/2014</HEARINGDATE><HEARINGTIME>10:00</HEARINGTIME><STATUS>Pending</STATUS><TRADE_NAME/><B1_PER_GROUP>Licenses</B1_PER_GROUP><B1_PER_TYPE>Business</B1_PER_TYPE><B1_PER_SUB_TYPE>Combined License</B1_PER_SUB_TYPE><B1_PER_CATEGORY>NA</B1_PER_CATEGORY><APPLICATION_DATE>2014-05-07T00:00:00.000-06:00</APPLICATION_DATE><OwnerIndex>2</OwnerIndex><OWNERNAME>Sally Hoiberg</OWNERNAME><OWNERTITLE>Minority Owner</OWNERTITLE><LICENSETYPE>Liquor - Special Facility</LICENSETYPE><OWNERCOMBINEDKEY>test combined license for Mike05/08/201410:002Sally HoibergMinority Owner</OWNERCOMBINEDKEY><COMBINEDKEY>test combined license for Mike05/08/201410:00</COMBINEDKEY></AccelaHearingDataOutput><AccelaHearingDataOutput><BUSINESSNAME>test combined license for Mike</BUSINESSNAME><B1_FULL_ADDRESS>201 E Colfax Ave</B1_FULL_ADDRESS><B1_SITUS_CITY>Denver</B1_SITUS_CITY><B1_SITUS_STATE>CO</B1_SITUS_STATE><HEARINGDATE>05/08/2014</HEARINGDATE><HEARINGTIME>10:00</HEARINGTIME><STATUS>Pending</STATUS><TRADE_NAME/><B1_PER_GROUP>Licenses</B1_PER_GROUP><B1_PER_TYPE>Business</B1_PER_TYPE><B1_PER_SUB_TYPE>Combined License</B1_PER_SUB_TYPE><B1_PER_CATEGORY>NA</B1_PER_CATEGORY><APPLICATION_DATE>2014-05-07T00:00:00.000-06:00</APPLICATION_DATE><OwnerIndex>1</OwnerIndex><OWNERNAME>Fred Hoiberg</OWNERNAME><OWNERTITLE>Majority Owner</OWNERTITLE><LICENSETYPE>Liquor - Special Facility</LICENSETYPE><OWNERCOMBINEDKEY>test combined license for Mike05/08/201410:001Fred HoibergMajority Owner</OWNERCOMBINEDKEY><COMBINEDKEY>test combined license for Mike05/08/201410:00</COMBINEDKEY></AccelaHearingDataOutput><AccelaHearingDataOutput><BUSINESSNAME>test combined license for Mike</BUSINESSNAME><B1_FULL_ADDRESS>201 E Colfax Ave</B1_FULL_ADDRESS><B1_SITUS_CITY>Denver</B1_SITUS_CITY><B1_SITUS_STATE>CO</B1_SITUS_STATE><HEARINGDATE>05/08/2014</HEARINGDATE><HEARINGTIME>10:00</HEARINGTIME><STATUS>Pending</STATUS><TRADE_NAME/><B1_PER_GROUP>Licenses</B1_PER_GROUP><B1_PER_TYPE>Business</B1_PER_TYPE><B1_PER_SUB_TYPE>Combined License</B1_PER_SUB_TYPE><B1_PER_CATEGORY>NA</B1_PER_CATEGORY><APPLICATION_DATE>2014-05-07T00:00:00.000-06:00</APPLICATION_DATE><OwnerIndex>2</OwnerIndex><OWNERNAME>Sally Hoiberg</OWNERNAME><OWNERTITLE>Minority Owner</OWNERTITLE><LICENSETYPE>Amusement Facility - Permanent</LICENSETYPE><OWNERCOMBINEDKEY>test combined license for Mike05/08/201410:002Sally HoibergMinority Owner</OWNERCOMBINEDKEY><COMBINEDKEY>test combined license for Mike05/08/201410:00</COMBINEDKEY></AccelaHearingDataOutput><AccelaHearingDataOutput><BUSINESSNAME>test combined license for Mike</BUSINESSNAME><B1_FULL_ADDRESS>201 E Colfax Ave</B1_FULL_ADDRESS><B1_SITUS_CITY>Denver</B1_SITUS_CITY><B1_SITUS_STATE>CO</B1_SITUS_STATE><HEARINGDATE>05/08/2014</HEARINGDATE><HEARINGTIME>10:00</HEARINGTIME><STATUS>Pending</STATUS><TRADE_NAME/><B1_PER_GROUP>Licenses</B1_PER_GROUP><B1_PER_TYPE>Business</B1_PER_TYPE><B1_PER_SUB_TYPE>Combined License</B1_PER_SUB_TYPE><B1_PER_CATEGORY>NA</B1_PER_CATEGORY><APPLICATION_DATE>2014-05-07T00:00:00.000-06:00</APPLICATION_DATE><OwnerIndex>1</OwnerIndex><OWNERNAME>Fred Hoiberg</OWNERNAME><OWNERTITLE>Majority Owner</OWNERTITLE><LICENSETYPE>Amusement Facility - Permanent</LICENSETYPE><OWNERCOMBINEDKEY>test combined license for Mike05/08/201410:001Fred HoibergMajority Owner</OWNERCOMBINEDKEY><COMBINEDKEY>test combined license for Mike05/08/201410:00</COMBINEDKEY></AccelaHearingDataOutput></AccelaHearingDataOutputCollection> Expected response (2 Hearing's - 1 with 2 owners and no Combined License details and 1 with 2 different owners and 2 license details): <GetHearingDataResponse xmlns:ns0="http://www.denvergov.org/HearingDataService" xmlns="http://www.denvergov.org/HearingDataService"> <ns0:HearingResponseDetail> <ns0:BusinessName>Retail Marijuana Test</ns0:BusinessName> <ns0:TradeName>Merry Marijuana Store</ns0:TradeName> <ns0:BusinessAdddress>2443 S High St</ns0:BusinessAdddress> <ns0:City>Denver</ns0:City> <ns0:State>CO</ns0:State> <ns0:HearingDate>05/20/2014</ns0:HearingDate> <ns0:HearingTime>15:00</ns0:HearingTime> <ns0:Outcome>Pending</ns0:Outcome> <ns0:B1_Per_Group>Licenses</ns0:B1_Per_Group> <ns0:B1_Per_Type>Business</ns0:B1_Per_Type> <ns0:B1_Per_Sub_Type>Retail Marijuana Store</ns0:B1_Per_Sub_Type> <ns0:B1_Per_Category>NA</ns0:B1_Per_Category> <ns0:ApplicationDate>2014-04-23T00:00:00.000-06:00</ns0:ApplicationDate> <ns0:Owners> <ns0:Owner> <ns0:Name>Test Owner 1</ns0:Name> <ns0:Name>Owner 1</ns0:Name> </ns0:Owner> <ns0:Owner> <ns0:Name>Test Owner 3</ns0:Name> <ns0:Name>Owner 3</ns0:Name> </ns0:Owner> </ns0:Owners> <ns0:CombinedLicenseDetails> <ns0:LicenseType/> <ns0:LicenseType/> </ns0:CombinedLicenseDetails> </ns0:HearingResponseDetail> <ns0:HearingResponseDetail> <ns0:BusinessName>test combined license for Mike</ns0:BusinessName> <ns0:TradeName/> <ns0:BusinessAdddress>201 E Colfax Ave</ns0:BusinessAdddress> <ns0:City>Denver</ns0:City> <ns0:State>CO</ns0:State> <ns0:HearingDate>05/08/2014</ns0:HearingDate> <ns0:HearingTime>10:00</ns0:HearingTime> <ns0:Outcome>Pending</ns0:Outcome> <ns0:B1_Per_Group>Licenses</ns0:B1_Per_Group> <ns0:B1_Per_Type>Business</ns0:B1_Per_Type> <ns0:B1_Per_Sub_Type>Combined License</ns0:B1_Per_Sub_Type> <ns0:B1_Per_Category>NA</ns0:B1_Per_Category> <ns0:ApplicationDate>2014-05-07T00:00:00.000-06:00</ns0:ApplicationDate> <ns0:Owners> <ns0:Owner> <ns0:Name>Fred Hoiberg</ns0:Name> <ns0:Name>Majority Owner</ns0:Name> </ns0:Owner> <ns0:Owner> <ns0:Name>Sally Hoiberg</ns0:Name> <ns0:Name>Minority Owner</ns0:Name> </ns0:Owner> </ns0:Owners> <ns0:CombinedLicenseDetails> <ns0:LicenseType>Liquor - Special Facility</ns0:LicenseType> <ns0:LicenseType>Amusement Facility - Permanent</ns0:LicenseType> </ns0:CombinedLicenseDetails> </ns0:HearingResponseDetail> </GetHearingDataResponse> Here is my current attempt that obviously isn't working, but should help get you started. <?xml version="1.0" encoding="UTF-8" ?><?oracle-xsl-mapper <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. --> <mapSources> <source type="WSDL"> <schema location="../AccelaHearingData.wsdl"/> <rootElement name="AccelaHearingDataOutputCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/AccelaHearingData"/> </source> </mapSources> <mapTargets> <target type="WSDL"> <schema location="../HearingDataService.wsdl"/> <rootElement name="GetHearingDataResponse" namespace="http://www.denvergov.org/HearingDataService"/> </target> </mapTargets> <!-- GENERATED BY ORACLE XSL MAPPER 11.1.1.7.0(build 130301.0647.0008) AT [THU MAY 08 21:32:46 MDT 2014]. -->?><xsl:stylesheet version="2.0" xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/" xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20" xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue" xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath" xmlns:ns0="http://www.denvergov.org/HearingDataService" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:med="http://schemas.oracle.com/mediator/xpath" xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/db/AccelaIntegration/GetHearingData/AccelaHearingData" xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions" xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk" xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/AccelaHearingData" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ora="http://schemas.oracle.com/xpath/extension" xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator" xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap" exclude-result-prefixes="xsi xsl tns plt db xsd wsdl ns0 bpws xp20 mhdr bpel oraext dvm hwf med ids bpm xdk xref ora socket ldap"> <xsl:template match="/"> <ns0:GetHearingDataResponse> <xsl:for-each-group select="/db:AccelaHearingDataOutputCollection/db:AccelaHearingDataOutput" group-by="./db:COMBINEDKEY"> <xsl:variable name="currentRow" select="current()"/> <ns0:HearingResponseDetail> <ns0:BusinessName> <xsl:value-of select="$currentRow/db:BUSINESSNAME"/> </ns0:BusinessName> <ns0:TradeName> <xsl:value-of select="$currentRow/db:TRADE_NAME"/> </ns0:TradeName> <ns0:BusinessAdddress> <xsl:value-of select="$currentRow/db:B1_FULL_ADDRESS"/> </ns0:BusinessAdddress> <ns0:City> <xsl:value-of select="$currentRow/db:B1_SITUS_CITY"/> </ns0:City> <ns0:State> <xsl:value-of select="$currentRow/db:B1_SITUS_STATE"/> </ns0:State> <ns0:HearingDate> <xsl:value-of select="$currentRow/db:HEARINGDATE"/> </ns0:HearingDate> <ns0:HearingTime> <xsl:value-of select="$currentRow/db:HEARINGTIME"/> </ns0:HearingTime> <ns0:Outcome> <xsl:value-of select="$currentRow/db:STATUS"/> </ns0:Outcome> <ns0:B1_Per_Group> <xsl:value-of select="$currentRow/db:B1_PER_GROUP"/> </ns0:B1_Per_Group> <ns0:B1_Per_Type> <xsl:value-of select="$currentRow/db:B1_PER_TYPE"/> </ns0:B1_Per_Type> <ns0:B1_Per_Sub_Type> <xsl:value-of select="$currentRow/db:B1_PER_SUB_TYPE"/> </ns0:B1_Per_Sub_Type> <ns0:B1_Per_Category> <xsl:value-of select="$currentRow/db:B1_PER_CATEGORY"/> </ns0:B1_Per_Category> <ns0:ApplicationDate> <xsl:value-of select="$currentRow/db:APPLICATION_DATE"/> </ns0:ApplicationDate> <ns0:Owners> <xsl:for-each-group select="/db:AccelaHearingDataOutputCollection/db:AccelaHearingDataOutput" group-by="current-group()/db:OWNERCOMBINEDKEY"> <xsl:variable name="ownerRow" select="current()"/> <xsl:variable name="currentGroup" select="current-group()"/> <ns0:Owner> <ns0:Name> <xsl:value-of select="$ownerRow/db:OWNERNAME"/> </ns0:Name> <ns0:OwnerRowCombinedKey> <xsl:value-of select="$ownerRow/db:COMBINEDKEY"/> </ns0:OwnerRowCombinedKey> <ns0:CurrentRowCombinedKey> <xsl:value-of select="$currentRow/db:COMBINEDKEY"/> </ns0:CurrentRowCombinedKey> <ns0:OwnerCombinedKey> <xsl:value-of select="$ownerRow/db:OWNERCOMBINEDKEY"/> </ns0:OwnerCombinedKey> <ns0:CurrentGroupName> <xsl:value-of select="$currentGroup/db:OWNERNAME"/> </ns0:CurrentGroupName> <ns0:CurrentGroupCombinedKey> <xsl:value-of select="$currentGroup/db:COMBINEDKEY"/> </ns0:CurrentGroupCombinedKey> <ns0:CurrentGroupOwnerCombinedKey> <xsl:value-of select="$currentGroup/db:OWNERCOMBINEDKEY"/> </ns0:CurrentGroupOwnerCombinedKey> </ns0:Owner> </xsl:for-each-group> </ns0:Owners> <ns0:CombinedLicenseDetails> <xsl:for-each select="/db:AccelaHearingDataOutputCollection/db:AccelaHearingDataOutput[./db:COMBINEDKEY=$currentRow/db:COMBINEDKEY]"> <xsl:variable name="licenseRow" select="current()"/> <ns0:LicenseType> <xsl:value-of select="$licenseRow/db:LICENSETYPE"/> </ns0:LicenseType> </xsl:for-each> </ns0:CombinedLicenseDetails> </ns0:HearingResponseDetail> </xsl:for-each-group> </ns0:GetHearingDataResponse> </xsl:template></xsl:stylesheet> Any help would be greatly appreciated! Thanks, Mike
  3. Hi Martin - Thanks for the info. Sorry for the dumb question. I am slightly xsl challenged. The parameter is a node set. Mike
  4. Still struggling with this. Here is what I have in my xsl: <xsl:param name="ManualAlloc"/> <xsl:import href="http://lenzconsulting.com/xml-to-string/xml-to-string.xsl"/> <xsl:output method="xml" cdata-section-elements="ManualAlloc"/> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="ManualAlloc"> <xsl:copy> <xsl:call-template name="xml-to-string"> <xsl:with-param name="node-set" select="node()"/> </xsl:call-template> </xsl:copy> </xsl:template> ManualAlloc is the param I want converted to a string (minus the CDATA designation). I am getting back exactly what I am putting in. Ideas? Mike
  5. Hi Martin - I checked out the xml-to-string xsl file, but I don't see how to set up the input parameter. The examples were not very helpful. Can you provide more guidance? Thanks! Mike
  6. So, I solved my previous problem of getting an xml encoded string out into an xml structure. Now I have to get a structure out into an escaped string (see the "manualAllocXML" element below): <s:element name="AllocatePayment"><s:complexType><s:sequence><s:element minOccurs="0" maxOccurs="1" name="securityToken" type="s:string" /><s:element minOccurs="1" maxOccurs="1" name="effPayDate" type="s:dateTime" /><s:element minOccurs="0" maxOccurs="1" name="manualAllocXml" type="s:string" /></s:sequence></s:complexType></s:element> I have the manualAllocXML in normal format as such: <manualalloc xmlns:xsi="http://www.w3.org/20...Schema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" resultdescr="test" resultstatus="0" xmlns="http://www.replaceme...mas/ManualAlloc"> <revobjs> <revobj dirtyreadchecksum="57" id="154917"/> <taxbills> <taxbill dirtyreadchecksum="57" id="1484553" revobjid="154917"/> </taxbills> </revobjs> <allocs> <alloc amount="5805.73" revobjid="271968" rolltype="1000002" revenuesource="290019" cd="0" subcd="0" taxbillid="6714081"/> </allocs></manualalloc> but I need to get it into an xml encoded string as such: <manualalloc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" resultdescr="test" resultstatus="0" xmlns="http://www.replaceme.com/schemas/ManualAlloc"><revobjs><revobj dirtyreadchecksum="57" id="154917"/><taxbills><taxbill dirtyreadchecksum="57" id="1484553" revobjid="154917"/></taxbills></revobjs><allocs><alloc amount="5805.73" revobjid="271968" rolltype="1000002" revenuesource="290019" cd="0" subcd="0" taxbillid="6714081"/></allocs></manualalloc> Is there a clever way to do this? Thanks, Mike
  7. Thanks! Very good to know. I ended up using an oracle xpath function called parseEscapedXML where you can assign the string to an element of a defined xml type.
  8. Hi there - I am trying to deal with a response that I am getting from a webservice that has a string element that contains xml as such: <GetAmountDueResponse xmlns="http://www.changemeback.com"> <GetAmountDueResult><![CDATA[<amountsdue resultstatus=0" resultdescr="Successful" xmlns="http://www.changemeback.com/schemas/AmountsDue"> <revobjs> <revobj id="271968" pin="033719689" lendershortdescr="" lenderdescr="" serviceshortdescr="" servicedescr="" dirtyreadchecksum="1628" situsfreeformaddr="18151 E 6TH AVE" situscitystatezip="AURORA, CA 82311-9402" situsstreetnumber="18151" situsstreetnumbersfx="" situspredirectional="East" situsstreetname="6TH" situsstreettype="Avenue" situspostdirectional="" situsunittype="" situsunitnumber="" situscity="AURORA" situstateabbrev="CA" situspostalcd="82311-9402" /> </revobjs> <parties> <party id="271968006" revobjid="271968" name="MODULAR SPACES" nameprefix="" firstname="" middlename="" lastname="MODULAR SPACES" namesuffix="" attention="MODULAR SPACES" legalpartytype="102055" legalpartytypedesc="Proprietorship" addresstype="101600" deliveryaddr1="1200 SWEDESFORD RD" deliveryaddr2="BERWYN PA 19312-1078" address="1200 SWEDESFORD" citystatezip="BERWYN, CA 23312-1078" streetnumber="1200" predirectional="" streetname="SWEDESFORD" streettype="RD" postdirectional="" unittype="" unitnumber="" city="BERWYN" state="California" stateabbrev="CA" zipcode="23312-1078" country="" /> </parties> <taxbills> <taxbill id="6714081" revobjid="271968" taxyear="2009" billnumber="200903371968901" tscertificatenumber="" dirtyreadchecksum="1628"> <duedates> <duedate inst="1" datedue="3/2/2009" fulldatedue="4/30/2009" /> <duedate inst="2" datedue="6/15/2009" fulldatedue="4/30/2009" /> </duedates> <flags> <flag flagobjecttype="100252" id="15008893" /> </flags> </taxbill> </taxbills> <allocs> <alloc revobjid="271968" taxbillid="6714081" rolltype="1000002" revenuesource="290019" type="290085" cd="290090" inst="1" amount="2897.88" fullamount="2897.88" /> <alloc revobjid="271968" taxbillid="6714081" rolltype="1000002" revenuesource="290019" type="290085" cd="290090" inst="2" amount="2897.85" fullamount="2897.85" /> <alloc revobjid="271968" taxbillid="6714081" rolltype="1000002" revenuesource="290019" type="290087" cd="1000501" inst="1" amount="5.00" fullamount="5.00" /> <alloc revobjid="271968" taxbillid="6714081" rolltype="1000002" revenuesource="290019" type="290087" cd="1000501" inst="2" amount="5.00" fullamount="5.00" /> </allocs></amountsdue>]]></GetAmountDueResult> </GetAmountDueResponse> I have derived an xsd for it, but I need to know how to get the elements out of the string. Ideas?Thanks! Mike
×
×
  • Create New...