Hi Hilary
Thank you soooo much for the sample I can use the xslt as a template
for my other transforms And I now
know how I can see the output of the transform – making diagnosing much
easier.
I have realised that the SharePoint data connection has data
in the query half of the data connection
I have added that to the new 1.xml in the sample (see
attached) and now I get an error - An error occurred trying to process the
result as XML. Data at the root level is invalid. Line 1, position 1.
And the output is showing
2016-08-1811:00Shift A/Twilight<my:Stocks
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2016-09-13T18:54:00"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields">
<my:StocksTable><my:Description>Fred</my:Description><my:Type>Packet</my:Type><my:Count>100</my:Count><my:ID
/></my:StocksTable>
<my:StocksTable><my:Description>George</my:Description><my:Type>Bag</my:Type><my:Count>1000</my:Count><my:ID
/></my:StocksTable>
<my:StocksTable><my:Description>Helen</my:Description><my:Type>Bar</my:Type><my:Count>900</my:Count><my:ID
/></my:StocksTable>
</my:Stocks>
So it is picking up the information from the q:SharePointListItem_RW even though the template is trying to match dfs:dataFields
I have changed the commands in the sample to include a sourcepath
Transform /xsltfile=Stocks.xsl /sourceds=Stocks /sourcepath=/dfs:myFields/dfs:dataFields /destpath=/my:myFields/my:field1 /tostring=true
Transform /xsltfile=Stocks.xsl /sourceds=Stocks /sourcepath=/dfs:myFields/dfs:dataFields /destpath=/my:myFields/my:Stocks /excluderoot=true
so the output is now
<my:Stocks
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2016-09-13T18:54:00"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields">
<my:StocksTable><my:Description>Fred</my:Description><my:Type>Packet</my:Type><my:Count>100</my:Count><my:ID
/></my:StocksTable>
<my:StocksTable><my:Description>George</my:Description><my:Type>Bag</my:Type><my:Count>1000</my:Count><my:ID
/></my:StocksTable>
<my:StocksTable><my:Description>Helen</my:Description><my:Type>Bar</my:Type><my:Count>900</my:Count><my:ID
/></my:StocksTable>
</my:Stocks>
and I don't get any errors.
In my live form I have done the same.
So the commands are
Transform /xsltfile=Stocks.xsl /sourceds=Stocks /sourcepath=/dfs:myFields/dfs:dataFields /destpath=/my:myFields/my:Stocks /excluderoot=true
Transform /xsltfile=Stocks.xsl /sourceds=Stocks /sourcepath=/dfs:myFields/dfs:dataFields /destpath=/my:myFields/my:FormStatus/my:TransformOutput /tostring=true
The output looks like this
<my:Stocks
xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2016-09-13T18:54:00"
xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"
xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields">
<my:StocksTable><my:Description>M&S
Smoke
55g</my:Description><my:Type>Trays</my:Type><my:Count>4</my:Count><my:ID
/></my:StocksTable>
<my:StocksTable><my:Description>M&D
un-smoke
55g</my:Description><my:Type>Trays</my:Type><my:Count>8</my:Count><my:ID
/></my:StocksTable>
<my:StocksTable><my:Description>Co-op
Strippers</my:Description><my:Type>Cases</my:Type><my:Count>34</my:Count><my:ID
/></my:StocksTable>
</my:Stocks>
But now I have the following as an error - An error occurred setting the result of the transform. Schema validation found non-data type errors.
I have checked Description/Type/Count/ID elements in the main data source and they are all text fields.
I have obviously done something wrong - any ideas ?
Thank you
Catharine