Merge two XMLs files and only keep what is duplicated using XSLT - xslt

I have two XMLs that I would like to match and keep only the information that is on both.
The first one,
<?xml version="1.0" encoding="UTF-8"?>
<result>
<user>
<User>1</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2025</LastModified>
<Source>SF</Source>
</user>
<user>
<User>2</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2024</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>3</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/8/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>4</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>28/9/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>5</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>15/3/2025</LastModified>
<Source>SF</Source>
</user>
<user>
<User>6</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>14/3/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>7</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>24/11/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>8</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/6/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>9</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>26/12/2025</LastModified>
<Source>SF</Source>
</user>
<user>
<User>10</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>20/2/2025</LastModified>
<Source>SF</Source>
</user>
</result>
And the second one,
<?xml version="1.0" encoding="UTF-8"?>
<result>
<user>
<User>1</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>1/11/2023</LastModified>
<Source>CSV</Source>
<User>1</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>2</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2024</LastModified>
<Source>CSV</Source>
<User>2</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>1/12/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>3</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/8/2023</LastModified>
<Source>CSV</Source>
<User>3</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>5/7/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>4</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>28/9/2023</LastModified>
<Source>CSV</Source>
<User>4</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>24/1/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>5</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>15/3/2023</LastModified>
<Source>CSV</Source>
<User>5</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>10/3/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>6</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>14/3/2023</LastModified>
<Source>CSV</Source>
<User>6</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/3/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>7</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>24/11/2023</LastModified>
<Source>CSV</Source>
<User>7</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>27/10/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>8</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/6/2023</LastModified>
<Source>CSV</Source>
<User>8</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>17/4/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>9</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>26/12/2023</LastModified>
<Source>CSV</Source>
<User>9</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>16/11/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>10</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>13/3/2023</LastModified>
<Source>CSV</Source>
<User>10</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>20/2/2023</LastModified>
<Source>CSV</Source>
</user>
<user>
<User>1</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2025</LastModified>
<Source>SF</Source>
<User>1</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>1/11/2021</LastModified>
<Source>SF</Source>
</user>
<user>
<User>2</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2023</LastModified>
<Source>SF</Source>
<User>2</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>1/12/2022</LastModified>
<Source>SF</Source>
</user>
<user>
<User>3</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>5/7/2022</LastModified>
<Source>SF</Source>
<User>3</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/8/2021</LastModified>
<Source>SF</Source>
</user>
<user>
<User>4</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>24/1/2022</LastModified>
<Source>SF</Source>
<User>4</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>28/9/2020</LastModified>
<Source>SF</Source>
</user>
<user>
<User>5</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>15/3/2025</LastModified>
<Source>SF</Source>
<User>5</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>10/3/2024</LastModified>
<Source>SF</Source>
</user>
<user>
<User>6</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/3/2022</LastModified>
<Source>SF</Source>
<User>6</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>14/3/2021</LastModified>
<Source>SF</Source>
</user>
<user>
<User>7</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>24/11/2021</LastModified>
<Source>SF</Source>
<User>7</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>27/10/2020</LastModified>
<Source>SF</Source>
</user>
<user>
<User>8</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>9/6/2021</LastModified>
<Source>SF</Source>
<User>8</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>17/4/2020</LastModified>
<Source>SF</Source>
</user>
<user>
<User>9</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>26/12/2025</LastModified>
<Source>SF</Source>
<User>9</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>16/11/2021</LastModified>
<Source>SF</Source>
</user>
<user>
<User>10</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>20/2/2025</LastModified>
<Source>SF</Source>
<User>10</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>13/3/2022</LastModified>
<Source>SF</Source>
</user>
</result>
I would need to use XSLT to create a new XML that contains the same user and source.
For example,
On the first XML I have User '1' and Source 'SF' so I would need to keep from the second
<user>
<User>1</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2025</LastModified>
<Source>SF</Source>
<User>1</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>1/11/2021</LastModified>
<Source>SF</Source>
</user>
And remove the ones with source 'CSV'
<user>
<User>1</User>
<UniversityDegree>University of Missouri Masters</UniversityDegree>
<LastModified>1/11/2023</LastModified>
<Source>CSV</Source>
<User>1</User>
<UniversityDegree>University of Texas Bachelors</UniversityDegree>
<LastModified>1/1/2023</LastModified>
<Source>CSV</Source>
</user>
And then on User '2' I have Source 'CSV' so it would be the same but this time remove the ones with 'SF' and keep the 'CSV' ones

Related

Need to develop a hierarchical structure from flat file using two identifiers in Input XML

I am trying to develop a hierarchical structure from a flat file thus i need to establish parent child relationship in the desired output. Could you please suggest a method in XSLT 2.0.
Please find below the input XML which contains LEVEL and IDENTIFY tags on the basis of which i was trying to build the parent child relationship.
All the IDENTIFY tags with 'IB' should be in a separate tag like LOCATION and all the IDENTIFY tags with 'ER' should be in a separate tag like ADDRESS in output.
Input XML:
<Path>
<item>
<LEVEL>1</LEVEL>
<RANK>340</RANK>
<TYPE>T</TYPE>
<DESC>Sheet</DESC>
<NAME>I</NAME>
<IDENTIFY>IB</IDENTIFY>
</item>
<item>
<LEVEL>2</LEVEL>
<RANK/>
<TYPE>M</TYPE>
<DESC> Handler</DESC>
<NAME>D</NAME>
<IDENTIFY></IDENTIFY>
</item>
<item>
<LEVEL>2</LEVEL>
<RANK>341</RANK>
<TYPE>M</TYPE>
<DESC>handler </DESC>
<NAME>I</NAME>
<IDENTIFY>IB</IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK/>
<TYPE>M</TYPE>
<DESC>pdf</DESC>
<NAME>D</NAME>
<IDENTIFY></IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK>330</RANK>
<TYPE>M</TYPE>
<DESC>SERVO </DESC>
<NAME>L</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK>331</RANK>
<TYPE>M</TYPE>
<DESC>SENSOR</DESC>
<NAME>L</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
<item>
<LEVEL>2</LEVEL>
<RANK>342</RANK>
<TYPE>M</TYPE>
<DESC>xyz</DESC>
<NAME>I</NAME>
<IDENTIFY>IB</IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK>335</RANK>
<TYPE>M</TYPE>
<DESC>FILTER</DESC>
<NAME>L</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
<item>
<LEVEL>2</LEVEL>
<RANK>343</RANK>
<TYPE>M</TYPE>
<DESC>safety </DESC>
<NAME>I</NAME>
<IDENTIFY>IB</IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK/>
<TYPE>M</TYPE>
<DESC>doc</DESC>
<NAME>D</NAME>
<IDENTIFY></IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK>337</RANK>
<TYPE>M</TYPE>
<DESC>ROD </DESC>
<NAME>L</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK>338</RANK>
<TYPE>M</TYPE>
<DESC>CYL</DESC>
<NAME>L</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
<item>
<LEVEL>3</LEVEL>
<RANK>339</RANK>
<TYPE>M</TYPE>
<DESC>COMPRESSION </DESC>
<NAME>L</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
<item>
<LEVEL>2</LEVEL>
<RANK>345</RANK>
<TYPE>M</TYPE>
<DESC>Nylon</DESC>
<NAME>I</NAME>
<IDENTIFY>ER</IDENTIFY>
</item>
</Path>
Desired Output:
<LOCATION>
<LEVEL>1</LEVEL>
<RANK>340</RANK>
<TYPE>T</TYPE>
<DESC>Sheet</DESC>
<NAME>I</NAME>
</LOCATION>
<LOCATION>
<LEVEL>2</LEVEL>
<RANK/>
<TYPE>M</TYPE>
<DESC> Handler</DESC>
<NAME>D</NAME>
</LOCATION>
<LOCATION>
<LEVEL>2</LEVEL>
<RANK>341</RANK>
<TYPE>M</TYPE>
<DESC> handler </DESC>
<NAME>I</NAME>
</LOCATION>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK/>
<TYPE>M</TYPE>
<DESC>pdf</DESC>
<NAME>D</NAME>
</ADDRESS>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK>330</RANK>
<TYPE>M</TYPE>
<DESC>pqr</DESC>
<NAME>L</NAME>
</ADDRESS>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK>331</RANK>
<TYPE>M</TYPE>
<DESC>SENSOR</DESC>
<NAME>L</NAME>
</ADDRESS>
<LOCATION>
<LEVEL>2</LEVEL>
<RANK>342</RANK>
<TYPE>M</TYPE>
<DESC>xyz</DESC>
<NAME>I</NAME>
</LOCATION>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK>335</RANK>
<TYPE>M</TYPE>
<DESC>TER</DESC>
<NAME>L</NAME>
</ADDRESS>
<LOCATION>
<LEVEL>2</LEVEL>
<RANK>343</RANK>
<TYPE>M</TYPE>
<DESC>SAFE</DESC>
<NAME>I</NAME>
</LOCATION>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK/>
<TYPE>M</TYPE>
<DESC>doc</DESC>
<NAME>D</NAME>
</ADDRESS>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK>337</RANK>
<TYPE>M</TYPE>
<DESC>RST/DESC>
<NAME>L</NAME>
</ADDRESS>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK>338</RANK>
<TYPE>M</TYPE>
<DESC>CYL</DESC>
<NAME>L</NAME>
</ADDRESS>
<ADDRESS>
<LEVEL>3</LEVEL>
<RANK>339</RANK>
<TYPE>M</TYPE>
<DESC>COMP</DESC>
<NAME>L</NAME>
</ADDRESS>
<LOCATION>
<LEVEL>2</LEVEL>
<RANK>345</RANK>
<TYPE>M</TYPE>
<DESC>Nyl</DESC>
<NAME>I</NAME>
</LOCATION>

Consuming web services that ColdFusion does not generate

I'm a newbie to web services. I'm using ColdFusion 2016 and want to make a call to this service url: https://apitest.authorize.net/xml/v1/request.api. This service is written in C#. How can I call a service, from ColdFusion, which is written in other language?
One more thing, I want pass the below xml data as input. How can I do this?
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>API LOGIN ID</name>
<transactionKey>TRANSACTION KEY</transactionKey>
</merchantAuthentication>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>139.94</amount>
<payment>
<creditCard>
<cardNumber>5424000000000015</cardNumber>
<expirationDate>1220</expirationDate>
<cardCode>999</cardCode>
</creditCard>
</payment>
<order>
<invoiceNumber>INV-12345</invoiceNumber>
<description>Golf Supplies</description>
</order>
<lineItems>
<lineItem>
<itemId>243</itemId>
<name>Golf Bag</name>
<description>Blue wheeled golf bag</description>
<quantity>1</quantity>
<unitPrice>129.99</unitPrice>
</lineItem>
<lineItem>
<itemId>42</itemId>
<name>Golf Ball</name>
<description>Long Drive II Balls</description>
<quantity>5</quantity>
<unitPrice>1.99</unitPrice>
</lineItem>
</lineItems>
<customer>
<id>39432</id>
<email>customer#example.com</email>
</customer>
<billTo>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address>1234 Main St</address>
<city>Pecan Springs</city>
<state>TX</state>
<zip>44628</zip>
<country>USA</country>
</billTo>
<shipTo>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address>PO Box 3432</address>
<city>Pecan Springs</city>
<state>TX</state>
<zip>44628</zip>
<country>USA</country>
</shipTo>
</transactionRequest>
</createTransactionRequest>
I found a solution for this.
<cfsavecontent variable="strXML">
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>API LOGIN ID</name>
<transactionKey>TRANSACTION KEY</transactionKey>
</merchantAuthentication>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>139.94</amount>
<payment>
<creditCard>
<cardNumber>5424000000000015</cardNumber>
<expirationDate>1220</expirationDate>
<cardCode>999</cardCode>
</creditCard>
</payment>
<order>
<invoiceNumber>INV-12345</invoiceNumber>
<description>Golf Supplies</description>
</order>
<lineItems>
<lineItem>
<itemId>243</itemId>
<name>Golf Bag</name>
<description>Blue wheeled golf bag</description>
<quantity>1</quantity>
<unitPrice>129.99</unitPrice>
</lineItem>
<lineItem>
<itemId>42</itemId>
<name>Golf Ball</name>
<description>Long Drive II Balls</description>
<quantity>5</quantity>
<unitPrice>1.99</unitPrice>
</lineItem>
</lineItems>
<customer>
<id>39432</id>
<email>customer#example.com</email>
</customer>
<billTo>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address>1234 Main St</address>
<city>Pecan Springs</city>
<state>TX</state>
<zip>44628</zip>
<country>USA</country>
</billTo>
<shipTo>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address>PO Box 3432</address>
<city>Pecan Springs</city>
<state>TX</state>
<zip>44628</zip>
<country>USA</country>
</shipTo>
</transactionRequest>
</createTransactionRequest>
</cfsavecontent>
<cfhttp
method="post"
url=" https://apitest.authorize.net/xml/v1/request.api"
result="objGet"
>
<cfhttpparam
type="XML"
value="#strXML.Trim()#"
/>
</cfhttp>
<cfdump var="#objGet#"/>

Jasper list element inside table element with XML datasource

I'm trying to generate a report, using Jasper iReport Designer 5.6.0, with table that contains lists inside its cells. The generated table could look like this:
To do this, I'm using the following XML file as datasource:
<report>
<table>
<persons>
<person>
<id>111</id>
<name>John</name>
<addresses>
<address>Johan's Street 1</address>
<address>Johan's Street 2</address>
<address>Johan's Street 3</address>
</addresses>
</person>
<person>
<id>222</id>
<name>Marko</name>
<addresses>
<address>Marko's Street 1</address>
<address>Marko's Street 2</address>
</addresses>
</person>
<person>
<id>333</id>
<name>Tito</name>
<addresses>
<address>Tito's Street 1</address>
<address>Tito's Street 2</address>
<address>Tito's Street 3</address>
<address>Tito's Street 4</address>
</addresses>
</person>
</persons>
</table>
</report>
And JRXML template:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="TableWithList" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="2347c131-1884-430a-b77f-59f08f896c8a">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<subDataset name="PersonsTable" uuid="1470ca7f-50f9-4781-9af7-ed3e04841738">
<queryString language="xPath">
<![CDATA[/report/table/persons/person]]>
</queryString>
<field name="person" class="java.lang.String">
<fieldDescription><![CDATA[child::text()]]></fieldDescription>
</field>
<field name="id" class="java.lang.String">
<fieldDescription><![CDATA[id]]></fieldDescription>
</field>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
</subDataset>
<subDataset name="AddressesList" uuid="5c62f1af-dfc1-49ca-8615-493009f964f6">
<queryString language="xPath">
<![CDATA[/report/table/persons/person/addresses]]>
</queryString>
<field name="address" class="java.lang.String">
<fieldDescription><![CDATA[address]]></fieldDescription>
</field>
</subDataset>
<queryString language="xPath">
<![CDATA[/report]]>
</queryString>
<detail>
<band height="175" splitType="Stretch">
<componentElement>
<reportElement key="table" x="0" y="0" width="308" height="50" uuid="d3ef2b70-5a74-4ebf-85f5-36fbcac91938"/>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="PersonsTable" uuid="41f6ef78-fb40-4d6f-9998-e31689321fc8">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/report/table/persons/person")]]></dataSourceExpression>
</datasetRun>
<jr:column width="122" uuid="3bbeb837-7663-4af6-b2f4-759be2c88102">
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="122" height="30" uuid="3bc07e10-17f3-45ea-8df9-69a3968dc689"/>
<text><![CDATA[NAMES]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="33" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="122" height="33" uuid="9d26eb70-a1bc-443c-8fd1-25bcefc6dd58"/>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="185" uuid="1f779e6e-316b-4442-8e36-c020b7b50d6b">
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="185" height="30" uuid="59998a31-67a7-4ebe-bd15-6f6d3ec38231"/>
<text><![CDATA[ADDRESSES]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="33" rowSpan="1">
<componentElement>
<reportElement x="0" y="0" width="185" height="33" uuid="e6ed252e-e104-489d-bf10-b3ffb0f3ad0e"/>
<jr:list printOrder="Vertical">
<datasetRun subDataset="AddressesList" uuid="03bc1640-16e7-4111-b48a-0b77e01baefa">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/report/table/persons/person/addresses")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="33" width="185">
<textField>
<reportElement x="0" y="0" width="185" height="33" uuid="eb98e95f-d395-4404-a77b-1660f1de9fd0"/>
<textFieldExpression><![CDATA[$F{address}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
And this is what I'm getting as resulting report:
Is it possible to have a list element inside the table element? If yes, what I'm doing wrong?
You are close
Your <subDataset name="PersonsTable"> is correct!
Your <subDataset name="AddressesList"> should be
<subDataset name="AddressesList" uuid="5c62f1af-dfc1-49ca-8615-493009f964f6">
<queryString language="xPath">
<![CDATA[/report/table/persons/person/addresses/address]]>
</queryString>
<field name="address" class="java.lang.String">
<fieldDescription><![CDATA[child::text()]]></fieldDescription>
</field>
</subDataset>
You need to arrive to node address
Since your person table already works we need only to fix the dataSourceExpression for the <jr:list>
<datasetRun subDataset="AddressesList" uuid="c8e1bd7e-b4d8-4e48-8b06-e8fd59846d69">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/person/addresses/address")]]></dataSourceExpression>
</datasetRun>
Thats it

JWildCardHandler Internal 500 Error when submitting form

We are getting this relentless 500 error on a coldfusion site. We are using Coldfusion 9.0.1 and only when we submit a form to update a database table we get this error. Only one page causes it, but there is nothing in the logs indicating what happened.
I turned on detailed errors for this one site and I see that the error is caused by the JWildCardHandler with error code 0x00000000.
I've checked permissions on everything. Even on the Access DB that is being used.
I tried this same code and database on another server and I receive no error at all. I tried making sure the config was the exact same for IIS and CF on both servers and still get the error.
Any ideas? There just seems to be no reason that it's throwing this error.
Here is the form processing page that is causing the error. Really not much, just some basic queries:
<cfquery datasource="#Datasource#" name="UpdateTheTable">
UPDATE Our_table SET
#Est# = #PreserveSingleQuotes(EstValue)#,
Username = '#CurrentUser.Username#',
DateCurrent = NOW()
WHERE Attribute1=#CurrentUser.Attribute1ID# AND Attribute2=#Attribute2ID#;
</cfquery>
Here is our stack trace:
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type='text/xsl' href='freb.xsl'?>
<!-- saved from url=(0014)about:internet -->
<failedRequest url="http://oursite.domain.com:80/subdir/index.cfm"
siteId="8"
appPoolId="subdir"
processId="13528"
verb="POST"
remoteUserName=""
userName=""
tokenUserName="NT AUTHORITY\IUSR"
authenticationType="anonymous"
activityId="{00000000-0000-0000-7E06-0080000000E2}"
failureReason="STATUS_CODE"
statusCode="500"
triggerStatusCode="500"
timeTaken="202"
xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>1</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.490Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
<Data Name="SiteId">8</Data>
<Data Name="AppPoolId">subdir</Data>
<Data Name="ConnId">1610614393</Data>
<Data Name="RawConnId">0</Data>
<Data Name="RequestURL">http://oursite.domain.com:80/subdir/index.cfm</Data>
<Data Name="RequestVerb">POST</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_REQUEST_START</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>12</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.490Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_ISAPI_HANDLER</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>1</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.599Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>ISAPI_START</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{2E94E6C7-EDA0-4B73-9010-2529EDCE1C27}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ISAPI Extension" Guid="{A1C2040E-8840-4C31-BA11-9871031A19EA}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>1</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.599Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
<Data Name="DllName">C:\ColdFusion9\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>CALL_ISAPI_EXTENSION</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{ACADE3B2-B7D7-4339-956C-811B4EDB1B24}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ISAPI Extension" Guid="{A1C2040E-8840-4C31-BA11-9871031A19EA}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>2</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.614Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>ISAPI_EXTENSION_DONE</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{ACADE3B2-B7D7-4339-956C-811B4EDB1B24}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>2</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.614Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>ISAPI_END</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{2E94E6C7-EDA0-4B73-9010-2529EDCE1C27}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>33</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.614Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpSubStatus">0</Data>
<Data Name="FileNameOrURL">500.htm</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_SEND_CUSTOM_ERROR</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>2</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2013-04-22T13:36:17.692Z"/>
<Correlation ActivityID="{00000000-0000-0000-7E06-0080000000E2}"/>
<Execution ProcessID="13528" ThreadID="13628"/>
<Computer>Server1</Computer>
</System>
<EventData>
<Data Name="ContextId">{00000000-0000-0000-7E06-0080000000E2}</Data>
<Data Name="BytesSent">6428</Data>
<Data Name="BytesReceived">4864</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpSubStatus">0</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_REQUEST_END</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
</failedRequest>
I recently ran into the same problem, same error, same 0x00000000 error code, same even down to the occurrence on a single form (other forms were working fine). The problem boiled down to the "postParametersLimit" setting in CF's neo-runtime.xml. The form data was exceeding the limit, causing CF to reject the request, and surfacing the error at the point of the JWildCardHandler handler. I simply increased the postParametersLimit in neo-runtime (using Notepad, just do a text search for that parameter name in the xml file. You'll see the value for it. Change. Save.) and restarted the CF services. All is good. I am running 64bit CF9.0.2 on load-balanced 64bit Win2008 R2 servers. Good luck.

XSLT Child Nodes Copy from parent node

I want to copy nodes from parent to the child. I am not really sure how this can be acheived.
My source xml
<Root1>
<Family1>
<Childrens>
<Child>
<ChildFirstName>Robin1</ChildFirstName>
<ChildLastName>Jackman1</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
<Activities>
<Sports>
<Cricket>
<ParticipentNames>
</ParticipentNames>
</Cricket>
</Sports>
</Activities>
</Child>
<Child>
<ChildFirstName>Robin2</ChildFirstName>
<ChildLastName>Jackman2</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
<Activities>
<Sports>
<Cricket>
<ParticipentNames>
</ParticipentNames>
</Cricket>
</Sports>
</Activities>
</Child>
<Child>
<ChildFirstName>Robin3</ChildFirstName>
<ChildLastName>Jackman3</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
<Activities>
<Sports>
<Cricket>
<ParticipentNames>
</ParticipentNames>
</Cricket>
</Sports>
</Activities>
</Child>
</Childrens>
</Family1>
</Root1>
I would like to get the output as
<Root1>
<Family1>
<Childrens>
<Child>
<ChildFirstName>Robin1</ChildFirstName>
<ChildLastName>Jackman1</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
<Activities>
<Sports>
<Cricket>
<ParticipentNames>
<ChildFirstName>Robin1</ChildFirstName>
<ChildLastName>Jackman1</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
</ParticipentNames>
</Cricket>
</Sports>
</Activities>
</Child>
<Child>
<ChildFirstName>Robin2</ChildFirstName>
<ChildLastName>Jackman2</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
<Activities>
<Sports>
<Cricket>
<ParticipentNames>
<ChildFirstName>Robin2</ChildFirstName>
<ChildLastName>Jackman2</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
</ParticipentNames>
</Cricket>
</Sports>
</Activities>
</Child>
<Child>
<ChildFirstName>Robin3</ChildFirstName>
<ChildLastName>Jackman3</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
<Activities>
<Sports>
<Cricket>
<ParticipentNames>
<ChildFirstName>Robin3</ChildFirstName>
<ChildLastName>Jackman3</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
</ParticipentNames>
</Cricket>
</Sports>
</Activities>
</Child>
</Childrens>
</Family1>
</Root1>
I want the solution in XSLT 1.0.
I want to copy these nodes to child nodes
<ChildFirstName>Robin3</ChildFirstName>
<ChildLastName>Jackman3</ChildLastName>
<Address>
<Street1>Street1</Street1>
<State>State</State>
<Country>Country</Country>
</Address>
Thanks.
<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:template match="ParticipentNames">
<xsl:copy>
<xsl:apply-templates select="ancestor::Child/ChildFirstName | ancestor::Child/ChildLastName | ancestor::Child/Address"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
should suffice (might want to add <xsl:output indent="yes"/> and <xsl:strip-space elements="*"/> for better formatting).