Jump to content
Server Maintenance This Week. ×

Export XML - xsl multiple columns


Glorifindal

This topic is 3926 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am attempting to export XML and transform it - from Filemaker, to be usable in Word. For straight fields- no problem. For related data - I have it working, but once I start to attempt any sort transform, that's where I get unstuck.
I have 3 columns that I want to format as follows ( as a table - it would actually be a table within a cell - BUT, perhaps someone has a better suggestion that a table within a cell ? ):

Nr. Name    Type     Call-Sign
1   Jones     Extra    BRD2
2   Trucker   New     GF21
3    Brint      Extra    ASD2

I have got the Name column working fine... I just need the Nr. column ( position () ) and the other 2 columns to work...they always return empty....( but if I swap out their variable name with the name column it does work - so they are pulling data )
In the code that follows, Please excuse the Word mark-up...I have put the xls code in question in blue
 
<code>
<w:tbl>
<w:tblPr>
<w:tblW w:w="0" w:type="auto"/>
<w:tblBorders>
<w:top w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:left w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:bottom w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:right w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:insideH w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
<w:insideV w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblLook w:val="04A0"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="1427"/>
<w:gridCol w:w="1427"/>
<w:gridCol w:w="1428"/>
</w:tblGrid>
<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW[1]/fmp:COL[$Name]/fmp:DATA">
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="000320AE" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:r>
<w:t><xsl:value-of select="."/></w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="000320AE" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:r>
<xsl:value-of select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW[1]/fmp:COL[$deviceEnv]/fmp:DATA" />
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="000320AE" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
<w:r>
<xsl:value-of select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW[1]/fmp:COL[$deviceEnv]/fmp:DATA" />
</w:r>
</w:p>
</w:tc>
</w:tr>
</xsl:for-each>
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
<w:tr wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidTr="00E337ED">
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1427" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="1428" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="auto"/>
</w:tcPr>
<w:p wsp:rsidR="00E337ED" wsp:rsidRPr="00E337ED" wsp:rsidRDefault="00E337ED" wsp:rsidP="00E337ED">
<w:pPr>
<w:spacing w:after="0" w:line="240" w:line-rule="auto"/>
</w:pPr>
</w:p>
</w:tc>
</w:tr>
</w:tbl>
</code>

Link to comment
Share on other sites

there is a method called "walking (or looping) the portal". basically you get the position() of the first field in the portal and then each other field tests for the same postion, but also going UP to the row level (and back down to the field). I can't tell by your code what you are setting and where.

the FMP export of related fields are like this:

<ROW

<COL

<DATA

<DATA

...

</COL

<COL

<DATA

<DATA

</COL

</ROW

 

Every record (ROW) should have the same number of DATA elements for each of the related fields (COL).

 

Also, I"m not sure if you meant to say XSL(XSLT) instead of xls (which is an EXCEL extension).

Link to comment
Share on other sites

This topic is 3926 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.