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.

Adding an XSLT file

Featured Replies

Hi everyone,

I have a very short xml file see below - it seems a really good one to start with - I know I have to have an xslt file to work with this to convert it to fmpxmlresult grammar.

Are there any guides on how to write the xslt?

Many thanks

XML example as follows:

That one is pretty simple. They've put the data into "attributes" (name="value") in the Item "element."


<?xml version="1.0" encoding="utf-8"?>





	

		

			0

			

			

			

				

				

				

				

			

			

				

					

						0

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

					

				

			

		

	

P.S. You don't really need the "count()" stuff, for the number of records. Nor do you need the fancy MODID or RECORDID attribute counts. FileMaker is happy to import them if they're blank, or whatever number, as long as the attribute is there. So, a simpler alternative xsl for the same thing,

Oh, one thing. The <?xml version="1.0"?> element, with the optional encoding attribute, must be absolutely the 1st thing in the file, no spaces before it or nothin'.

<?xml version="1.0" encoding="utf-8"?>

0

Edited by Guest

  • Author

Hi Fenton,

Thank you for the quick response. I am very grateful.

Do I need to just copy and paste your code into a "notepad" file and save with an xsl extension?

(Sorry to be so dense)

Simon

No, I'll attach a file. If you look carefully at the example code I pasted into the post, you will see that the PHP engine of the forum has screwed it up. If I enclose it with a "code" tag (1st post), then it drops the "?>" end of the xml declaration. If I don't enclose it with a a "code" tag, it translates the ">" at the end of the "for-each" line into "&g t;". Either of these would stop it from validating or working as an xsl file. That is why I suggested attaching your xml file. Except for the simplest xml, it is impossible to post it directly without it getting subtly screwed up. Which doesn't help a beginner much.

Download the attached file instead.

PCML_2.xsl.zip

  • Author

Hi Fenton,

Have been having a go with this - doing pretty well (up to a point!)

Did actually make a manual import work - ie up to the point where you had to match the XML fields up to target fields so fantastic.

BUT

absolutely no luck in a script with an import

message is as follows:

"XML Parsing error

An exception occured

Type: NetAccessorException

Message: Could not open file {0}

Line no 0

columnn no 0"

And this was after it had worked on a manual import?

Any clues?

Cheers

Simon

  • Author

Fenton,

Sorry I hadn't seen your last post - will have a go with your downloaded file first

Many thanks

  • Author

Hi

Still no luck - its like filemaker can't read the path (in a code sense)

Simon

  • Author

Hi guys

Fenton, thank you for all your help earlier.

No matter what I try to do to solve the probem (including stopping and restarting server, closing databases etc)

...When I try and do a direct import or a scripted import all I get is the error message:

"XML Parsing error

An exception occured

Type: NetAccessorException

Message: Could not open file {0}

Line no 0

columnn no 0"

Do you or anybody else have any clue what to do about this - I am sure that the everything else would work - if it could only deal with this error

Many thanks

Simon

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.