Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Repeating nodes/elements in XSLT Expand / Collapse
Author
Message
Posted Wednesday, February 26, 2014 10:00 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 6:19 AM
Points: 2,041, Visits: 3,493
I posted this question to StackOverflow. Maybe someone here might be able to help me out.

The background: I've been tasked with building an ASP.NET form based on a US government grant application. I managed to find the XSD schema, and am building an XSLT file based on the schema.

I'm building the form based on other working forms. I ran a debug trace to see how the form works, and discovered that it takes the XSLT template, fills in the blanks (so to speak), and saves the entire thing as XML. It works pretty well, and I'd really like to avoid reinventing the wheel.

Here's my problem: The schema includes a complexType element that allows up to 5 occurrences (i.e. maxOccurs = "5"). That element includes another complexType element with another maxOccurs = "5". And inside of that is another complexType element that allows up to 100 occurrences.

5 x 5 x 100 = 2500 elements?!? I don't think so!!!

Does anyone know if there's a way to create these XSLT elements without having to write them out (or copy/paste them) 2500 times??? I tried the <xsl:for-each>, but it won't work in this scenario (refer to my background above about how it first reads the template, then fills in the data for the nodes). I've been looking up documentation all over the place, and I have yet to find anything that helps me.

Thanks for reading, and your anticipated response . . .
Post #1545478
Posted Friday, February 28, 2014 10:00 AM This worked for the OP Answer marked as solution
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 6:19 AM
Points: 2,041, Visits: 3,493
After a couple of days of fruitless searching for an answer to this, I bit the bullet, copy/pasted all my elements, and hardcoded the XSLT.

Probably not the best solution, but it does what I need.
Post #1546449
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse