Problems with xsl:result-document and the creation of multiple files from a single source - xslt-2.0

I’m having issues attempting to get XSLT 2's result-document element to work properly. What I have in this case is an xml file with subscriber data in it and an xsl that is designed to transform it into a CSV.
I have a need in the solution to be able to specify several product codes and have the xsl transform the source document into multiple files one for each code in my selection.
Upon executing the following using the Saxon transform tool as follows:
C:\XSLTransformer\Transform.exe -xsl:"Example - Multifile Writer.xsl" -s:"Example.xml"
I get the files being created with names of Data Export Flatfile - P-PRPL.txt and Data Export Flatfile - P-YLW.txt. Both of the files contain the field headers, but neither file contains any actual data.
So, to reiterate the pdts: and csv: parts of the XSLT are being used correctly, as I’m able to render the files, but it seems that the supplied document is either being ignored, or the transform tool is having issues processing it in some way.
I know the XSLT in the file works, as I have a “manual” version of it that works without issue, but this one, where I hope to be able to automate some of the file production but giving it a bunch of codes to work on isn’t.
I suspect that the problem possibly lies with the transfer of the $code variable into the RenderRows template, but I can’t seem to put my finger on what exactly it is.
All help appreciated.
Thanks.
Example - Multifile Writer.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" exclude-result-prefixes="#all" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:csv="csv:csv" xmlns:pdts="pdts:pdts">
<xsl:strip-space elements="*"/>
<xsl:output name="text" method="text" indent="no" omit-xml-declaration="yes" encoding="UTF-8"/>
<xsl:variable name="columnDelimiter" as="xs:string" select="' '"/>
<xsl:variable name="rowDelimiter" as="xs:string" select="'
'"/>
<!-- Modify this list to generate output for whatever other product codes you’re interested in -->
<!-- The solution will generate a new file for each product code. -->
<pdts:products>
<product Code="P-PURPLE" FileCode="P-PRPL"/>
<product Code="P-YELLOW" FileCode="P-YLW"/>
</pdts:products>
<!-- Output Columns -->
<csv:columns>
<column>Unique Reference Number</column>
<column>Contact (Donor)</column>
<column>Firstname</column>
<column>Surname</column>
<column>Company Name</column>
<column>Address 1</column>
<column>Address 2</column>
<column>City</column>
<column>PostCode</column>
<column>State</column>
<column>Country</column>
<column>Email</column>
<column>Mob Number</column>
<column>Tel Number</column>
<column>Product Offer</column>
<column>Start Date</column>
<column>End Date</column>
</csv:columns>
<xsl:variable name="path" as="xs:string" select="'C:\Temp\'"/>
<xsl:template match="/"> <!-- Match the root -->
<xsl:for-each select="document('')/*/pdts:products/*">
<xsl:variable name="filename" select="concat('file:///',$path,'Data Export Flatfile - ',#FileCode,'.txt')"/>
<xsl:variable name="code" select="#Code"/>
<xsl:result-document href="{$filename}" format="text">
<!-- Output the CSV headers -->
<xsl:call-template name="RenderColumnHeadings"/>
<!-- Output the individual rows -->
<xsl:call-template name="RenderRows">
<xsl:with-param name="prmPackage" select="/Subscribers/Organisations//Subscription[#PackageCode = $code]"/>
</xsl:call-template>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
<xsl:template name="RenderColumnHeadings">
<xsl:for-each select="document('')/*/csv:columns/*">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="$columnDelimiter"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$rowDelimiter"/>
</xsl:template>
<xsl:template name="RenderRows">
<xsl:param name="prmPackage"/>
<xsl:for-each select="$prmPackage">
<!-- Variables: Life made simpler -->
<xsl:variable name="subscription" as="element(Subscription)" select="."/>
<xsl:variable name="subscriber" as="element(BusinessUnit)" select="$subscription/../../."/>
<xsl:variable name="organisation" as="element(Organisation)" select="$subscriber/../../."/>
<xsl:variable name="memberAddress" as="element(Address)" select="$subscriber//Address[#Type='Subscription']/."/>
<xsl:for-each select="$subscription//Recipient"><!-- Recipients -->
<xsl:variable name="publication" as="element(Publication)" select="./../../."/>
<xsl:value-of select="$subscription/#Id"/><!-- URN -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="concat($subscriber/Contact/#Forename,' ',$subscriber/Contact/#Surname)"/><!-- Contact (Donor) -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="substring-before(#ContactDisplayName,' ')"/><!-- Firstname -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="substring-after(#ContactDisplayName,' ')"/><!-- Surname -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="$organisation/#Name"/><!-- Company Name -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="Address/Line1"/><!-- Address 1 -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="Address/Line2"/><!-- Address 2 -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="Address/City"/><!-- City -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="Address/PostCode"/><!-- PostCode -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="Address/State"/><!-- State -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="Address/Country"/><!-- Country -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="#EmailAddress"/><!-- Email -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="#Cellular"/><!-- Mob Number -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="#Phone"/><!-- Tel Number -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="$subscription/#Name"/><!-- Product Offer -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="$subscription/#WhenStarts"/><!-- Start Date -->
<xsl:value-of select="$columnDelimiter"/>
<xsl:value-of select="$subscription/#WhenExpires"/><!-- End Date -->
<xsl:value-of select="$rowDelimiter"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
Example Source Document
<Subscribers>
<Individuals>
<Individual Id="16493" Name="Alpha Zulu">
<Contact Id="16493" Forename="Alpha" Surname="Zulu" EmailAddress="alpha.zulu#alphabet.tld.dm" />
<Subscriptions>
<Subscription Id="181570" PackageCode="P-PURPLE" Name="Mike + Digital Edition" WhenCreated="2014-05-04T04:03:17.237" WhenStarts="2014-06-01T00:00:00" WhenExpires="2015-05-31T23:59:59.997" SubscriptionStatus="Current">
<GenericProducts />
<SecuredAccessProducts />
<Publications>
<Publication Id="148042" PublicationID="46" ProductCode="M-PURPLE" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="0" Quantity="1" ProductClassId="4">
<Recipients>
<Recipient Id="153364" ContactId="16493" ContactTypeId="1" ContactDisplayName="Alpha Zulu" Copies="1" WhenCreated="2014-05-04T04:03:17.247" EmailAddress="gZulu#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
<Publication Id="148043" PublicationID="114" ProductCode="M-RED" VersionNumber="1" Name="Delta Complimentary" IssueCount="0" Quantity="1" ProductClassId="34">
<Recipients>
<Recipient Id="153365" ContactId="16493" ContactTypeId="1" ContactDisplayName="Alpha Zulu" Copies="1" WhenCreated="2014-05-04T04:03:17.267" EmailAddress="gZulu#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
</Subscriptions>
<Addresses>
<Address Type="Subscription">
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Addresses>
</Individual>
<Individual Id="23477" Name="Bravo Yankee">
<Contact Id="23477" Forename="Bravo" Surname="Yankee" EmailAddress="bravo.yankee#alphabet.tld.dm" />
<Subscriptions>
<Subscription Id="186018" PackageCode="P-YELLOW" Name="Mike Essential Package 10" WhenCreated="2014-07-04T08:50:04.767" WhenStarts="2014-07-04T00:00:00" WhenExpires="2015-07-03T23:59:59.997" SubscriptionStatus="Current">
<GenericProducts />
<SecuredAccessProducts>
<SecuredProduct Id="64886" SCAProductId="1" ProductCode="S-YELLOW" VersionNumber="1" MembershipTypeId="2" Name="Mike News.NET Standard 10" MaxMembers="10" LockedMemberCount="1" Quantity="1" ExternalName="Mike Standard 10" ProductClassId="1">
<Members>
<Member Id="16106772" Forename="Bravo" Surname="Yankee" EmailAddress="bravo.yankee#alphabet.tld.dm" />
</Members>
</SecuredProduct>
</SecuredAccessProducts>
<Publications>
<Publication Id="151954" PublicationID="46" ProductCode="M-PURPLE" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="12" Quantity="3" ExternalName="Monthly" ProductClassId="4">
<Recipients>
<Recipient Id="157514" ContactId="23477" ContactTypeId="1" ContactDisplayName="Bravo Yankee" Copies="1" WhenCreated="2014-07-04T08:50:05.493" EmailAddress="gYankee#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="157515" ContactId="10226666" ContactTypeId="1" ContactDisplayName="Whiskey Zulu" Copies="2" WhenCreated="2014-07-04T08:50:05.787" EmailAddress="" >
<Address />
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
</Subscriptions>
<Addresses>
<Address Type="Subscription">
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Addresses>
</Individual>
<Individual Id="73120" Name="Alpha Hotel">
<Contact Id="73120" Forename="Alpha" Surname="Hotel" EmailAddress="alpha.hotel#alphabet.tld.dm" />
<Subscriptions>
<Subscription Id="183293" PackageCode="P-PURPLE" Name="Mike + Digital Edition" WhenCreated="2014-06-03T04:03:40.483" WhenStarts="2014-07-01T00:00:00" WhenExpires="2015-06-30T23:59:59.997" SubscriptionStatus="Current">
<GenericProducts />
<SecuredAccessProducts />
<Publications>
<Publication Id="149560" PublicationID="46" ProductCode="M-PURPLE" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="0" Quantity="1" ProductClassId="4">
<Recipients>
<Recipient Id="155023" ContactId="73120" ContactTypeId="1" ContactDisplayName="Alpha Hotel" Copies="1" WhenCreated="2014-06-03T04:03:40.503" EmailAddress="Alpha.harvey#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
<Publication Id="149561" PublicationID="114" ProductCode="M-RED" VersionNumber="1" Name="Delta Complimentary" IssueCount="0" Quantity="1" ProductClassId="34">
<Recipients>
<Recipient Id="155024" ContactId="73120" ContactTypeId="1" ContactDisplayName="Alpha Hotel" Copies="1" WhenCreated="2014-06-03T04:03:40.543" EmailAddress="Alpha.harvey#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
</Subscriptions>
<Addresses>
<Address Type="Subscription">
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Addresses>
</Individual>
</Individuals>
<Organisations>
<Organisation Id="13" Name="Alpha Limited">
<BusinessUnits>
<BusinessUnit Id="560" Name="Bravo WA, Australia" Facsimile="">
<Contact Id="1062276946" Forename="Kilo" Surname="Bravo" EmailAddress="kilo.bravo#alphabet.tld.dm" />
<Agency />
<Subscriptions>
<Subscription Id="168271" PackageCode="P-YELLOW" Name="Mike Essential Plus Package 25" WhenCreated="2014-01-24T04:03:02.103" WhenStarts="2014-02-21T00:00:00" WhenExpires="2015-02-20T23:59:59.997" SubscriptionStatus="Renewed">
<GenericProducts />
<SecuredAccessProducts>
<SecuredProduct Id="60181" SCAProductId="3" ProductCode="S-MNP1Y" VersionNumber="1" MembershipTypeId="3" Name="Mike News.NET Premium 25" MaxMembers="25" LockedMemberCount="1" Quantity="1" ExternalName="Mike Premium 25" ProductClassId="2">
<Members />
</SecuredProduct>
</SecuredAccessProducts>
<Publications>
<Publication Id="133606" PublicationID="46" ProductCode="M-PURPLE" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="0" Quantity="5" ProductClassId="4">
<Recipients>
<Recipient Id="138626" BusinessUnitId="560" ContactId="8342" ContactTypeId="2" ContactDisplayName="Indigo Charlie" Copies="1" WhenCreated="2014-01-24T04:03:02.410" EmailAddress="indigo.charlie#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="138627" BusinessUnitId="4807005" ContactId="121315" ContactTypeId="2" ContactDisplayName="Mike Sierra" Copies="1" WhenCreated="2014-01-24T04:03:02.423" EmailAddress="mike.sierra#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="138628" BusinessUnitId="3844766" ContactId="149273" ContactTypeId="2" ContactDisplayName="Papa Delta" Copies="1" WhenCreated="2014-01-24T04:03:02.437" EmailAddress="papa.delta#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="138658" BusinessUnitId="4807007" ContactId="18761725" ContactTypeId="2" ContactDisplayName="Sierra Bravo" Copies="2" WhenCreated="2014-01-24T13:58:06.787" EmailAddress="sierra.bravo#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
<Subscription Id="202338" PackageCode="P-YELLOW" Name="Mike Essential Plus Package 25" WhenCreated="2015-01-24T04:03:04.277" WhenStarts="2015-02-21T00:00:00" WhenExpires="2016-02-20T23:59:59.997" SubscriptionStatus="Current">
<GenericProducts />
<SecuredAccessProducts>
<SecuredProduct Id="71637" SCAProductId="3" ProductCode="S-MNP1Y" VersionNumber="1" MembershipTypeId="3" Name="Mike News.NET Premium 25" MaxMembers="25" LockedMemberCount="1" Quantity="1" ExternalName="Mike Premium 25" ProductClassId="2">
<Members>
<Member Id="5351" Forename="Indigo" Surname="Charlie" EmailAddress="indigo.charlie#alphabet.tld.dm" />
<Member Id="7755" Forename="Kilo" Surname="Bravo" EmailAddress="kilo.bravo#alphabet.tld.dm" />
<Member Id="7756" Forename="Lima" Surname="Charlie" EmailAddress="lima.charlie#alphabet.tld.dm" />
<Member Id="7758" Forename="Tango" Surname="Romeo" EmailAddress="tango.romeo#alphabet.tld.dm" />
<Member Id="104333" Forename="Mike" Surname="Sierra" EmailAddress="mike.sierra#alphabet.tld.dm" />
<Member Id="109664" Forename="Delta" Surname="Mike" EmailAddress="delta.mike#alphabet.tld.dm" />
<Member Id="128216" Forename="Papa" Surname="Delta" EmailAddress="papa.delta#alphabet.tld.dm" />
<Member Id="9599153" Forename="Sierra" Surname="Bravo" EmailAddress="sierra.bravo#alphabet.tld.dm" />
<Member Id="9644184" Forename="Mike" Surname="Bravo" EmailAddress="mike.bravo#alphabet.tld.dm" />
<Member Id="12953504" Forename="Sierra" Surname="Papa" EmailAddress="sierra.papa#alphabet.tld.dm" />
<Member Id="12953505" Forename="Kilo" Surname="Mike" EmailAddress="kilo.mike#alphabet.tld.dm" />
<Member Id="12953927" Forename="Alpha" Surname="Juliet" EmailAddress="alpha.juliet#alphabet.tld.dm" />
<Member Id="16059657" Forename="Kilo" Surname="Delta" EmailAddress="kilo.delta#alphabet.tld.dm" />
<Member Id="16061101" Forename="Bravo" Surname="Whiskey" EmailAddress="bravo.whiskey#alphabet.tld.dm" />
<Member Id="16061102" Forename="November" Surname="Echo" EmailAddress="november.echo#alphabet.tld.dm" />
<Member Id="16350124" Forename="Kilo" Surname="Papa" EmailAddress="kilo.papa#alphabet.tld.dm" />
<Member Id="16350125" Forename="November" Surname="Charlie" EmailAddress="november.charlie#alphabet.tld.dm" />
<Member Id="16372932" Forename="Hotel" Surname="Hotel" EmailAddress="hotel.hotel#alphabet.tld.dm" />
<Member Id="16372933" Forename="Sierra" Surname="Juliet" EmailAddress="sierra.juliet#alphabet.tld.dm" />
<Member Id="38777399" Forename="Sierra" Surname="Romeo" EmailAddress="sierra.romeo#alphabet.tld.dm" />
</Members>
</SecuredProduct>
</SecuredAccessProducts>
<Publications>
<Publication Id="166113" PublicationID="46" ProductCode="M-GREEN" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="0" Quantity="5" ProductClassId="4">
<Recipients>
<Recipient Id="172383" BusinessUnitId="560" ContactId="8342" ContactTypeId="2" ContactDisplayName="Indigo Charlie" Copies="1" WhenCreated="2015-01-24T04:03:04.287" EmailAddress="ichalmers#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="172384" BusinessUnitId="4807005" ContactId="121315" ContactTypeId="2" ContactDisplayName="Mike Sierra" Copies="1" WhenCreated="2015-01-24T04:03:04.290" EmailAddress="mike.sierra#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="172385" BusinessUnitId="3844766" ContactId="149273" ContactTypeId="2" ContactDisplayName="Papa Delta" Copies="1" WhenCreated="2015-01-24T04:03:04.297" EmailAddress="papa.delta#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="172386" BusinessUnitId="4807007" ContactId="18761725" ContactTypeId="2" ContactDisplayName="Sierra Bravo" Copies="2" WhenCreated="2015-01-24T04:03:04.303" EmailAddress="sierra.bravo#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
</Subscriptions>
<Addresses>
<Address Type="Subscription">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
<Address Type="Standard">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
<Address Type="Charlie Register">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Addresses>
</BusinessUnit>
</BusinessUnits>
</Organisation>
<Organisation Id="17" Name="Bravo Limited">
<BusinessUnits>
<BusinessUnit Id="546" Name="Echo PERTH, WA, Australia" MSDynamicsId="35352" Facsimile="61 8 6218 8880">
<Contact Id="1084704665" Forename="Hotel" Surname="Whiskey" EmailAddress="hotel.whiskey#alphabet.tld.dm" />
<Agency />
<Subscriptions>
<Subscription Id="176647" Name="Mike Paid 1 Year" WhenCreated="2014-04-14T10:14:43.287" WhenStarts="2014-06-21T00:00:00" WhenExpires="2015-06-20T23:59:59.997" SubscriptionStatus="Current">
<GenericProducts />
<SecuredAccessProducts />
<Publications>
<Publication Id="142935" PublicationID="46" ProductCode="M-GREEN" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="12" Quantity="10" ProductClassId="4">
<Recipients>
<Recipient Id="148228" BusinessUnitId="546" ContactId="1062276276" ContactTypeId="2" ContactDisplayName="Romeo Charlie" Copies="6" WhenCreated="2014-04-14T11:51:17.710" EmailAddress="romeo.charlie#alphabet.tld.dm" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
<Recipient Id="175024" BusinessUnitId="4807112" ContactId="10226666" ContactTypeId="2" ContactDisplayName="Whiskey Zulu" Copies="4" WhenCreated="2015-02-19T14:22:01.540" EmailAddress="" >
<Address />
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
</Subscriptions>
<Addresses>
<Address Type="Subscription">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
<Address Type="Standard">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
<Address Type="Charlie Register">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Addresses>
</BusinessUnit>
</BusinessUnits>
</Organisation>
<Organisation Id="32" Name="Delta Limited">
<BusinessUnits>
<BusinessUnit Id="70579" Name="Mike VIC, Australia" Facsimile="">
<Contact Id="17874450" Forename="Kilo" Surname="Foxtrot" EmailAddress="kilo.foxtrot#alphabet.tld.dm" />
<Agency />
<Subscriptions>
<Subscription Id="173024" PackageCode="P-YELLOW" Name="Mike Essential Plus Package 25" WhenCreated="2014-03-19T04:04:28.137" WhenStarts="2014-04-16T00:00:00" WhenExpires="2015-04-15T23:59:59.997" SubscriptionStatus="Current">
<GenericProducts />
<SecuredAccessProducts>
<SecuredProduct Id="61926" SCAProductId="3" ProductCode="S-MNP1Y" VersionNumber="1" MembershipTypeId="3" Name="Mike News.NET Premium 25" MaxMembers="25" LockedMemberCount="1" Quantity="1" ExternalName="Mike Premium 25" ProductClassId="2">
<Members>
<Member Id="514" Forename="Romeo" Surname="Lima" EmailAddress="romeo.lima#alphabet.tld.dm" />
<Member Id="104734" Forename="Romeo" Surname="Mike" EmailAddress="romeo.mike#alphabet.tld.dm" />
<Member Id="1007933" Forename="Romeo" Surname="Bravo" EmailAddress="romeo.bravo#alphabet.tld.dm" />
<Member Id="1087600" Forename="Delta" Surname="Foxtrot" EmailAddress="delta.foxtrot#alphabet.tld.dm" />
<Member Id="2408219" Forename="Alpha" Surname="Lima" EmailAddress="alpha.lima#alphabet.tld.dm" />
<Member Id="9597365" Forename="Kilo" Surname="Foxtrot" EmailAddress="kilo.foxtrot#alphabet.tld.dm" />
<Member Id="9983336" Forename="Juliet" Surname="Delta" EmailAddress="juliet.delta#alphabet.tld.dm" />
<Member Id="9983338" Forename="Alpha" Surname="Charlie" EmailAddress="alpha.charlie#alphabet.tld.dm" />
<Member Id="12975663" Forename="Sierra" Surname="Juliet" EmailAddress="sierra.juliet#alphabet.tld.dm" />
<Member Id="16349491" Forename="Alpha" Surname="Mike" EmailAddress="alpha.mike#alphabet.tld.dm" />
</Members>
</SecuredProduct>
</SecuredAccessProducts>
<Publications>
<Publication Id="137472" PublicationID="46" ProductCode="M-GREEN" VersionNumber="1" Name="Mike Paid 1 Year" IssueCount="0" Quantity="5" ProductClassId="4">
<Recipients>
<Recipient Id="142694" BusinessUnitId="70579" ContactId="23270" ContactTypeId="2" ContactDisplayName="Bravo Hotel" Copies="5" WhenCreated="2014-03-19T04:04:28.240" EmailAddress="" >
<Address>
<Line1>123 AAA ST</Line1>
<Line2></Line2>
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Recipient>
</Recipients>
</Publication>
</Publications>
</Subscription>
</Subscriptions>
<Addresses>
<Address Type="Subscription">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
<Address Type="Standard">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
<Address Type="Charlie Register">
<Line1>123 AAA ST</Line1>
<Line2 />
<City>CCC</City>
<State>SSS</State>
<PostCode>9999</PostCode>
<Country>Australia</Country>
</Address>
</Addresses>
</BusinessUnit>
</BusinessUnits>
</Organisation>
</Organisations>

Change
<xsl:template match="/"> <!-- Match the root -->
<xsl:for-each select="document('')/*/pdts:products/*">
<xsl:variable name="filename" select="concat('file:///',$path,'Data Export Flatfile - ',#FileCode,'.txt')"/>
<xsl:variable name="code" select="#Code"/>
<xsl:result-document href="{$filename}" format="text">
<!-- Output the CSV headers -->
<xsl:call-template name="RenderColumnHeadings"/>
<!-- Output the individual rows -->
<xsl:call-template name="RenderRows">
<xsl:with-param name="prmPackage" select="/Subscribers/Organisations//Subscription[#PackageCode = $code]"/>
</xsl:call-template>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
to
<xsl:template match="/"> <!-- Match the root -->
<xsl:variable name="root" select="."/>
<xsl:for-each select="document('')/*/pdts:products/*">
<xsl:variable name="filename" select="concat('file:///',$path,'Data Export Flatfile - ',#FileCode,'.txt')"/>
<xsl:variable name="code" select="#Code"/>
<xsl:result-document href="{$filename}" format="text">
<!-- Output the CSV headers -->
<xsl:call-template name="RenderColumnHeadings"/>
<!-- Output the individual rows -->
<xsl:call-template name="RenderRows">
<xsl:with-param name="prmPackage" select="$root/Subscribers/Organisations//Subscription[#PackageCode = $code]"/>
</xsl:call-template>
</xsl:result-document>
</xsl:for-each>
</xsl:template>

Related

SAPUI5 PlanningCalendar - binding two entities

I have the following problem:
I'm developing an APP using the flameworks PlanningCalendar, but I have two EntitySet:
Salas(3):
CAPACIDADE: 6
ID: 3
NOME: "SALA 3"
NavReservas: {__deferred: {…}}
__metadata: {type: "room_sfsf.rooms.SalasType", uri: "https://leandrp822648trial.hanatrial.ondemand.com:443/room_sfsf/rooms.xsodata/Salas(3)"}
__proto__: Object
__proto__: Object
and:
Reservas(1):
DATA_FIM: Tue Sep 18 2018 14:00:00 GMT-0300 (Horário Padrão de Brasília) {}
DATA_INICIO: Tue Sep 18 2018 12:00:00 GMT-0300 (Horário Padrão de Brasília) {}
ID: 1
ID_SALA: 3
NOME: "caio"
USUARIO: "caio.amorim"
__metadata:
type: "room_sfsf.rooms.ReservasType"
uri: "https://leandrp822648trial.hanatrial.ondemand.com:443/room_sfsf/rooms.xsodata/Reservas(1)
"
but I can not get the two to appear on the screen, but I can not get the two to appear on the related screen, Below is the view file:
<mvc:View
controllerName="br.com.successfactors.itz.MeetingRoomSuccessfactors.controller.Main"
xmlns:mvc="sap.ui.core.mvc"
xmlns:unified="sap.ui.unified"
xmlns="sap.m">
<VBox class="sapUiSmallMargin">
<PlanningCalendar
id="PC1"
startDate="{path: '/startDate'}"
rows="{path : '/Salas', parameters:{$expand: 'NavReservas'}}"
appointmentSelect="handleAppointmentSelect"
>
<toolbarContent>
<Title text="{i18n>title}" titleStyle="H4"/>
<ToolbarSpacer/>
<Button id="addButton" icon="sap-icon://add" press="handleAppointmentCreate" tooltip="Add"/>
</toolbarContent>
<rows>
<PlanningCalendarRow
id="PCR"
title="{NOME}"
text="{i18n>QuantRoom} {CAPACIDADE}"
appointments="{path: '/Reservas', templateShareable: 'true'}"
>
<!--intervalHeaders="{path: 'Employees', templateShareable: 'true'}">-->
<appointments >
<unified:CalendarAppointment
startDate="{DATA_INICIO}"
endDate="{DATA_FIM}"
icon="{}"
title="{NOME}"
text="{USER}"
type="{}"
tentative="{}"
>
</unified:CalendarAppointment>
</appointments>
<!-- <intervalHeaders>
<unified:CalendarAppointment
startDate="{start}"
endDate="{end}"
icon="{pic}"
title="{title}"
type="{type}">
</unified:CalendarAppointment>
</intervalHeaders>-->
</PlanningCalendarRow>
</rows>
</PlanningCalendar>
</VBox>
</mvc:View>
below the metadata file:
<edmx:Edmx xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" Version="1.0">
<edmx:DataServices xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" m:DataServiceVersion="2.0">
<Schema xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2008/09/edm"
Namespace="room_sfsf.rooms">
<EntityType Name="SalasType">
<Key><PropertyRef Name="ID"/></Key><Property Name="ID" Type="Edm.Int32" Nullable="false"/><Property Name="NOME" Type="Edm.String" MaxLength="30"/><Property Name="CAPACIDADE" Type="Edm.Int32"/><NavigationProperty Name="NavReservas" Relationship="room_sfsf.rooms.Nav_ReservasType" FromRole="SalasPrincipal" ToRole="ReservasDependent"/></EntityType>
<EntityType Name="ReservasType">
<Key><PropertyRef Name="ID"/></Key><Property Name="ID" Type="Edm.Int32" Nullable="false"/><Property Name="NOME" Type="Edm.String" Nullable="false" MaxLength="30"/><Property Name="USUARIO" Type="Edm.String" MaxLength="20"/><Property Name="DATA_INICIO" Type="Edm.DateTime" Nullable="false"/><Property Name="DATA_FIM" Type="Edm.DateTime" Nullable="false"/><Property Name="ID_SALA" Type="Edm.Int32"/></EntityType>
<Association Name="Nav_ReservasType"><End Type="room_sfsf.rooms.SalasType" Role="SalasPrincipal" Multiplicity="1"/><End Type="room_sfsf.rooms.ReservasType" Role="ReservasDependent" Multiplicity="*"/>
<ReferentialConstraint>
<Principal Role="SalasPrincipal"><PropertyRef Name="ID"/></Principal>
<Dependent Role="ReservasDependent"><PropertyRef Name="ID_SALA"/></Dependent>
</ReferentialConstraint>
</Association>
<EntityContainer Name="rooms" m:IsDefaultEntityContainer="true"><EntitySet Name="Salas" EntityType="room_sfsf.rooms.SalasType"/><EntitySet Name="Reservas" EntityType="room_sfsf.rooms.ReservasType"/>
<AssociationSet Name="Nav_Reservas" Association="room_sfsf.rooms.Nav_ReservasType"><End Role="SalasPrincipal" EntitySet="Salas"/><End Role="ReservasDependent" EntitySet="Reservas"/></AssociationSet>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
image with the result on screen:
enter image description here
image the EntitySet:
enter image description here
Does anyone have any idea how I can solve this problem?
thank you so much.
ADD NEW COMMENT
I changed View after comment the Jorg, but not work, below:
<mvc:View
controllerName="br.com.successfactors.itz.MeetingRoomSuccessfactors.controller.Main"
xmlns:mvc="sap.ui.core.mvc"
xmlns:unified="sap.ui.unified"
xmlns="sap.m">
<VBox class="sapUiSmallMargin">
<PlanningCalendar
id="PC1"
startDate="{path: '/startDate'}"
rows="{path : '/Salas', parameters:{$expand: 'NavReservas'}}"
appointmentSelect="handleAppointmentSelect"
>
<toolbarContent>
<Title text="{i18n>title}" titleStyle="H4"/>
<ToolbarSpacer/>
<Button id="addButton" icon="sap-icon://add" press="handleAppointmentCreate" tooltip="Add"/>
</toolbarContent>
<rows>
<PlanningCalendarRow
id="PCR"
title="{NOME}"
text="{i18n>QuantRoom} {CAPACIDADE}"
appointments="{path: 'NavReservas', templateShareable: 'true'}"
>
<!--intervalHeaders="{path: 'Employees', templateShareable: 'true'}">-->
<appointments >
<unified:CalendarAppointment
startDate="{DATA_INICIO}"
endDate="{DATA_FIM}"
icon="{}"
title="{NOME}"
text="{USER}"
type="{}"
tentative="{}"
>
</unified:CalendarAppointment>
</appointments>
<!-- <intervalHeaders>
<unified:CalendarAppointment
startDate="{start}"
endDate="{end}"
icon="{pic}"
title="{title}"
type="{type}">
</unified:CalendarAppointment>
</intervalHeaders>-->
</PlanningCalendarRow>
</rows>
</PlanningCalendar>
</VBox>
</mvc:View>
Detail the error:
Uncaught Error: "[object Object]" is of type object, expected
sap.ui.core.URI for property "icon" of Element
sap.ui.unified.CalendarAppointment#__appointment0-__xmlview0--PCR-__xmlview0--PC1-0-0
at f.g.validateProperty (sap-ui-core.js:423)
at f.M.validateProperty (/resources/sap/ui/core/library-preload.js?eval:181)
at f.g.setProperty (sap-ui-core.js:421)
at f.setIcon (sap-ui-core.js:509)
at f.g.updateProperty (sap-ui-core.js:464)
at constructor.v (sap-ui-core.js:462)
at constructor.a.fireEvent (sap-ui-core.js:397)
at constructor.B._fireChange (sap-ui-core.js:1463)
at constructor.O.checkUpdate (/resources/sap/ui/core/library-preload.js?eval:2480)
at constructor.O.initialize (/resources/sap/ui/core/library-preload.js?eval:2475)
Image Result:
enter image description here
the browser it work!
{"d":{"results":[{"__metadata": {"type":"room_sfsf.rooms.ReservasType","uri":"https://leandrp822648trial.hanatrial.ondemand.com:443/room_sfsf/rooms.xsodata/Reservas(1)"},"ID":1,"NOME":"caio","USUARIO":"caio.amorim","DATA_INICIO":"\/Date(1537311600000)\/","DATA_FIM":"\/Date(1537318800000)\/","ID_SALA":3}]}}
enter image description here
Thanks.

Unable to manually set the intervals for Y axis

I have a HTML5 column chart in my jasper report. I need to configure the y axis and be able to set the intervals manually
I have used,
<property name="net.sf.jasperreports.chart.range.axis.tick.count" value="false"/>
<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="2"/>
It has no effect on the chart
The source code is as follows
<?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="customizechart" pageWidth="1000" pageHeight="1000" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="23a00417-b19d-4f98-aa59-dc6422d51386">
<property name="net.sf.jasperreports.chart.range.axis.tick.count" value="false"/>
<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="2"/>
<queryString>
<![CDATA[Select * from some_table]]>
</queryString>
<field name="Name" class="java.lang.String"/>
<field name="AppliedQuantity" class="java.lang.Float"/>
<summary>
<band height="959" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="960" height="500" uuid="774dd6b9-b5b9-4d3c-b518-6f7c7ca40043"/>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Column">
<hc:chartSetting name="default">
<hc:chartProperty name="chart.zoomType">
<hc:propertyExpression><![CDATA["xy"]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.href">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset/>
<dataAxis axis="Rows">
<axisLevel name="Name">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Name}]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Integer" calculation="Nothing">
<labelExpression><![CDATA["f"]]></labelExpression>
<valueExpression><![CDATA[$F{AppliedQuantity}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1"/>
</hc:chart>
</componentElement>
</band>
</summary>
</jasperReport>
Any ideas on this?
net.sf.jasperreports.chart.* properties apply to the charts built into the community/open source JasperReports library (which are based on JFreeChart).
For HTML5 charts - part of JasperReports Professional - what you have to do is set the yAxis.tickInterval property in the chart:
<hc:chartProperty name="yAxis.tickInterval">
<hc:propertyExpression><![CDATA[500]]></hc:propertyExpression>
</hc:chartProperty>

How to parse category with nokogiri?

I would like to know how to parse each 'category' from the following XML:
My code so far
doc = Nokogiri::XML(open(url))
xml.xpath("//category").each do |c|
standings_array.push(c)
end
XML
<?xml version="1.0" encoding="UTF-8"?>
<standings generated="2014-04-25T19:59:29Z">
<categories>
<category id="d1a50060-2ceb-45b6-ae08-b3a1ca38da86" name="Ukraine" country_code="UKR" country="Ukraine">
<tournament_group id="1a5bfc9a-57ed-49a6-9a9f-ac1e9f3fcc09" name="Premier League" season_start="2013-07-11T22:00:00Z" season_end="2014-05-05T21:59:00Z" season="2013">
<tournament id="417d7be0-3b5b-4573-9b72-e8c037093f6a" name="Premier League" season_start="2013-07-11T22:00:00Z" season_end="2014-05-05T21:59:00Z" season="2013">
<team id="4de003dc-8627-4ab3-adff-0b05f700e179" name="FC Shakhtar Donetsk" alias="SHA" country_code="UKR" country="Ukraine" type="team" rank="1" win="18" draw="2" loss="5" goals_for="54" goals_against="21" points="56" change="1" />
<team id="fc242f57-6a6f-4023-aef5-99310e6514dd" name="Dnipro Dnipropetrovsk" alias="DNI" country_code="UKR" country="Ukraine" type="team" rank="2" win="16" draw="6" loss="3" goals_for="49" goals_against="22" points="54" change="-1" />
<team id="fb78bcfc-5df9-4d3f-9097-944b1fa305aa" name="FC Dynamo Kiev" alias="DYK" country_code="UKR" country="Ukraine" type="team" rank="3" win="14" draw="5" loss="6" goals_for="49" goals_against="30" points="47" change="0" />
<team id="45c15051-6de0-4785-978e-3e1c91a11a86" name="Metalist Kharkiv" alias="KHA" country_code="UKR" country="Ukraine" type="team" rank="4" win="12" draw="9" loss="3" goals_for="46" goals_against="27" points="45" change="0" />
<team id="ecd4c7bf-2c7e-40a1-9dde-d4fa195b6485" name="Chernomorets Odessa" alias="CHE" country_code="UKR" country="Ukraine" type="team" rank="5" win="11" draw="7" loss="6" goals_for="26" goals_against="19" points="40" change="0" />
<team id="1435377f-0dbd-4b95-aeec-7bd48d759cbf" name="FC Zorya Lugansk" alias="ZOR" country_code="UKR" country="Ukraine" type="team" rank="6" win="9" draw="9" loss="6" goals_for="30" goals_against="24" points="36" change="2" />
<team id="766a69ed-1c8e-415b-9a3b-e561354fb2e7" name="Vorskla Poltava" alias="POL" country_code="UKR" country="Ukraine" type="team" rank="7" win="9" draw="9" loss="6" goals_for="33" goals_against="32" points="36" change="-1" />
<team id="e0635d1d-16cb-4dd2-849e-86656a71e063" name="FC Metalurg Donetsk" alias="DON" country_code="UKR" country="Ukraine" type="team" rank="8" win="9" draw="7" loss="8" goals_for="39" goals_against="38" points="34" change="-1" />
<team id="bb3e8242-9542-44f3-a09e-f7b5deb0710a" name="FC Illichivec Mariupol" alias="MAR" country_code="UKR" country="Ukraine" type="team" rank="9" win="9" draw="3" loss="12" goals_for="23" goals_against="28" points="30" change="1" />
<team id="6dd06d48-73eb-450b-880f-11f95be2e439" name="PFC Sevastopol" alias="SEV" country_code="UKR" country="Ukraine" type="team" rank="10" win="8" draw="4" loss="11" goals_for="27" goals_against="38" points="28" change="-1" />
<team id="33e18929-fb0a-432e-9797-b15e987b002c" name="Karpaty Lviv" alias="LVI" country_code="UKR" country="Ukraine" type="team" rank="11" win="6" draw="9" loss="9" goals_for="25" goals_against="32" points="27" change="1" />
<team id="1f8550b1-5ada-460c-ba84-5e7b551935e9" name="Volyn Lutsk" alias="VOL" country_code="UKR" country="Ukraine" type="team" rank="12" win="7" draw="6" loss="11" goals_for="23" goals_against="39" points="27" change="-1" />
<team id="20565616-f0c6-4560-a28f-bedeea31e476" name="Goverla-Uzhgorod" alias="UZG" country_code="UKR" country="Ukraine" type="team" rank="13" win="6" draw="4" loss="14" goals_for="19" goals_against="34" points="22" change="0" />
<team id="f6ea5689-e3d7-4f64-895b-cdc8303dc290" name="FC Metalurg Zaporizhya" alias="ZAP" country_code="UKR" country="Ukraine" type="team" rank="14" win="2" draw="5" loss="18" goals_for="17" goals_against="49" points="11" change="0" />
<team id="cdde3c63-807e-4935-b97f-a6cbd9ad3d92" name="Tavriya Simferopol" alias="SIM" country_code="UKR" country="Ukraine" type="team" rank="15" win="2" draw="3" loss="20" goals_for="14" goals_against="41" points="9" change="0" />
<team id="89293230-4c6e-45a7-84b3-1a98a8c03a32" name="Arsenal Kiev" alias="ARS" country_code="UKR" country="Ukraine" type="team" rank="16" win="0" draw="0" loss="0" goals_for="0" goals_against="0" points="0" change="0" />
</tournament>
</tournament_group>
</category>
</categories>
</standings>
// in xpath means the root. categories do not exist at the root of the document. (They are children of the //standings/categories/ collection).
You want to use //standings/categories/category to get each one.
doc = Nokogiri::XML(open(url))
doc.xpath("//standings/categories/category").each do |c|
# what do you want to do with the categories? I'll just print the id:
p c["id"]
end
Outputs:
d1a50060-2ceb-45b6-ae08-b3a1ca38da86
On that sample.
Thanks every one. For some reason it didn't work via Nokogiri, when I read the XML from an URL and I had to switch to XMLSimple. I have used Nokogiri before with no issues.
xml_data = Net::HTTP.get_response(URI.parse(url)).body
data = XmlSimple.xml_in(xml_data)
data["categories"][0].each do |c|
standings_array.push(c)
end

Nested tool-bar button in xul

I am having a toolbar-button with type "menu-button". Can I have two toolbar-buttons inside this one?
Since you would like to have a button inside a menu-button, here you go. But, this is not a pretty good UI.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="main-window">
<toolbox id="navigator-toolbox">
<toolbar id="xulschoolhello-toolbar" toolbarname="xulschoolhello.toolbarName.label;"
customizable="true" mode="icons" context="toolbar-context-menu"
defaultset="xulschoolhello-hello-world-button"
insertbefore="PersonalToolbar" />
<hbox>
<row> <button flex="1" type="menu" label="Menu">
<menupopup>
<menuitem label="Option 1" oncommand="setText('menu-text','Option 1');" />
<menuitem label="Option 2" oncommand="setText('menu-text','Option 2');" />
<menuitem label="Option 3" oncommand="setText('menu-text','Option 3');" />
<menuitem label="Option 4" oncommand="setText('menu-text','Option 4');" />
</menupopup>
</button> </row>
<row> <button flex="1" type="menu-button" label="MenuButton" oncommand="alert('Button was pressed!');">
<menupopup>
<menuitem label="Option A" oncommand="setText('menu-text','Option A');" />
<menuitem label="Option B" oncommand="setText('menu-text','Option B');" />
<menuitem label="Option C" oncommand="setText('menu-text','Option C');" />
<menuitem label="Option D" oncommand="setText('menu-text','Option D');" />
</menupopup>
</button></row>
</hbox>
<hbox pack="center">
<description id="menu-text" value="Testing" />
</hbox>
</toolbox>
</window>
</window>

Child Window Template SilverLight 3

How to change the GUI of the child window in silverlight , how to apply template or style any good example reference will help.
thanks in advance
For addition information:
I would like to change the title bar shape, the close button shape and the body area shape as well, you can say I want to change the View of the childWidow control.
Here's the template as outputted from Blend.
<ControlTemplate x:Key="ChildWindowControlTemplate1" TargetType="controls:ChildWindow">
<Grid x:Name="Root">
<Grid.Resources>
<Style x:Key="ButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FF1F3B53"/>
<Setter Property="Foreground" Value="#FF000000"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFA3AEB9" Offset="0"/>
<GradientStop Color="#FF8399A9" Offset="0.375"/>
<GradientStop Color="#FF718597" Offset="0.375"/>
<GradientStop Color="#FF617584" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="grid" Background="#02FFFFFF" HorizontalAlignment="Center" Height="14" VerticalAlignment="Center" Width="15">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz2">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz1">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Duration="0" To="0.95" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Duration="0" To="0.85" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz2">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz1">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Path x:Name="X_Fuzz2" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#14C51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="#14C51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1.3" ScaleX="1.3"/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<Path x:Name="X_Fuzz1" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#1EC51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="#1EC51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1.1" ScaleX="1.1"/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<Path x:Name="X_Fuzz0" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#FFC51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" Stretch="Fill" Stroke="#FFC51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9"/>
<Path x:Name="X" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#FFFFFFFF" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="0.7" Stretch="Fill" VerticalAlignment="Center" Width="9">
<Path.Stroke>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF313131" Offset="1"/>
<GradientStop Color="#FF8E9092" Offset="0"/>
</LinearGradientBrush>
</Path.Stroke>
</Path>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="WindowStates">
<VisualState x:Name="Open">
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
<SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
<SplineDoubleKeyFrame KeyTime="0" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
<SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Closed">
<Storyboard>
<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
<SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="Overlay" Background="{TemplateBinding OverlayBrush}" HorizontalAlignment="Stretch" Margin="0" Opacity="{TemplateBinding OverlayOpacity}" VerticalAlignment="Top"/>
<Grid x:Name="ContentRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Height="{TemplateBinding Height}" RenderTransformOrigin="0.5,0.5" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Grid.RenderTransform>
<Border BorderBrush="#14000000" BorderThickness="1" Background="#14000000" CornerRadius="2" HorizontalAlignment="Stretch" Margin="-1" VerticalAlignment="Stretch"/>
<Border BorderBrush="#0F000000" BorderThickness="1" Background="#0F000000" CornerRadius="2.25" HorizontalAlignment="Stretch" Margin="-2" VerticalAlignment="Stretch"/>
<Border BorderBrush="#0C000000" BorderThickness="1" Background="#0C000000" CornerRadius="2.5" HorizontalAlignment="Stretch" Margin="-3" VerticalAlignment="Stretch"/>
<Border BorderBrush="#0A000000" BorderThickness="1" Background="#0A000000" CornerRadius="2.75" HorizontalAlignment="Stretch" Margin="-4" VerticalAlignment="Stretch"/>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="#FFFFFFFF" CornerRadius="2">
<Border CornerRadius="1.5" Margin="1">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFE5E8EB" Offset="1"/>
<GradientStop Color="#FFF6F8F9" Offset="0"/>
</LinearGradientBrush>
</Border.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border x:Name="Chrome" BorderBrush="#FFFFFFFF" BorderThickness="0,0,0,1" Width="Auto" Background="{StaticResource LightBackground}">
<Grid Height="Auto" Width="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<ContentControl Content="{TemplateBinding Title}" FontWeight="Bold" HorizontalAlignment="Stretch" IsTabStop="False" Margin="6,0,6,0" VerticalAlignment="Center" Background="White" Foreground="White"/>
<Button x:Name="CloseButton1" Grid.Column="1" HorizontalAlignment="Center" Height="14" IsTabStop="False" Style="{StaticResource ButtonStyle}" VerticalAlignment="Center" Width="15" Foreground="White"/>
</Grid>
</Border>
<Border Background="{TemplateBinding Background}" Margin="0" Grid.Row="1">
<ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</Grid>
</Border>
</Border>
</Grid>
</Grid>
</ControlTemplate>
HTH, Stimul8d

Resources