Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Need XLST for XML file help. Nested elements.


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

Recommended Posts

Posted (edited)

Hello, I am trying to import the below files. I know that the .xsl file is not completely right, but have come close. Problem right now is that the nested elements show up as separate records instead of all the same records. Although fields match.

DNSWellness.zip

Edited by Guest
Updated attached files
Posted

In your XML example, there is one incident with two clients. Do you want to create a record for each incident - and if so, how do you intend to handle the multiple clients - or are you importing into a Clients table?

Posted

No, they need to be in the same record. My current thought process is to import them all into a temp table, then transfer them into their appropriate tables. I have set the temp table up so that it can handle the importing of up to 5 clients, which should be sufficient. The problem is that I still have not been able to grab the client data from the xml file due to their nesting. If I use "" I get the data, but it sees each new section as a separate record.

Posted

If I use "" I get the data, but it sees each new section as a separate record.

Yes, because "INCIDENT/*" means "any child node of INCIDENT" - so you are telling it to create a new record for each , or . You should only create a new

and then pick the field values by their section/subsection, e.g.B)

My current thought process is to import them all into a temp table, then transfer them into their appropriate tables.

Why not import them directly to their table, using another stylesheet?

Posted

You can only import into one table at a time. This stylesheet will create a new record for each . In order to import into a Clients table you would need another stylesheet, where a would be created:

Posted

You can only import into one table at a time. This stylesheet will create a new record for each . In order to import into a Clients table you would need another stylesheet, where a would be created:

Yes, would import them all into the "temp table", but would still like to create a separate record for each repeating client. Was going to have the person on the other end of the xml file include the incident id with each client so that I could then process the temp table and send the client section to the client table, but still tied to the correct incident. Was think more of something like . Will play around with it to see if I can get that to work. A separate stylesheet would not be that much more trouble, just would like to keep it consolidated if possible.

Posted

Was going to have the person on the other end of the xml file include the incident id with each client

That's not really necessary - the stylesheet can lookup the incident id from the parent node.

If you only want to import once, into a temp table, then I believe it would be best to "flatten" the table, i.e. create a record for each client with all the incident data included in it. Then import the client fields into Clients, and incident fields into the Incidents table (with IncidentID validated as unique - so multiple clients will be imported as one incident).

This topic is 5453 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.