Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Ahoy there !

I'm trying to make a xml import, but seams something I'm missing.

The import access from the next link : http://www.sagasoft.ro/infoTert.php…

The xslt it's here.
When I'm importing, shows I have one record , but empty.

Where I'm wrong.

saga.xslt

1 hour ago, Marius said:

Where I'm wrong.

You have managed to make three major mistakes in just one short instruction:

<xsl:value-of select="tert/@cod_fiscal"/>

First, your template matches the / root node, but tert is a child of ds. So already your path will select nothing. Next, cod_fiscal is an element, not an attribute - so you should not be putting  a @ in front of it.

The third problem is a little more difficult: your XML places all its elements in a namespace. You must declare the same namespace in your stylesheet, assign it a prefix and use that prefix when addressing the elements in the source XML. Try the following stylesheet:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns="http://tempuri.org/ds.xsd"
exclude-result-prefixes="ns">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="/">
    <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
        <METADATA>
            <FIELD NAME="Cod Fiscal"/>
        </METADATA>
        <RESULTSET>
            <ROW>
                <COL><DATA><xsl:value-of select="ns:ds/ns:tert/ns:cod_fiscal"/></DATA></COL>
            </ROW>
        </RESULTSET>
    </FMPXMLRESULT>
</xsl:template>

</xsl:stylesheet>

Note that the above assumes there will always be at most one record to import. Otherwise you will need to change it to something like:

<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns="http://tempuri.org/ds.xsd"
exclude-result-prefixes="ns">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="/ns:ds">
    <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
        <METADATA>
            <FIELD NAME="Cod Fiscal"/>
        </METADATA>
        <RESULTSET>
            <xsl:for-each select="ns:tert">
                <ROW>
                    <COL><DATA><xsl:value-of select="ns:cod_fiscal"/></DATA></COL>
                </ROW>
            </xsl:for-each>
        </RESULTSET>
    </FMPXMLRESULT>
</xsl:template>

</xsl:stylesheet>

(assuming tert translates to a record).

 

 

  • Author

Wau, works very good !

Thanks very much, for your advice & solution.

I have tried also ds/tert/cod_fiscal, but I didn't get I have to put  a namespace in it.

 

Thanks a lot,

Marius

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.