|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Sanitizing dataI've got an interesting problem that I'm hoping to solve with XSLT.
Basically I have an XML document inbound which could contain additional nodes that I do not currently handle in my XSL template; or worst still a node with multiple child nodes of which I am only expecting a single child node. Can anyone give any pointers on the easiest way to trap and identify the additional data in the source XML that my template does not handle? I've considered: * Using XSL debugging commands to throw exceptions, but how to identify them? * Pumping out all un-processed data to a single text block at the end of the FO for visibility. But how can identify un-processed nodes? * Pre-parse the xml with another XSLT, kind of redundant/not ideal Thanks, JV |
|
|
|
|
|
Re: Sanitizing dataDavid,
Sorry about not providing a sample, the data was sensitive; I 've tried to sum up the data here: <page> <page_type> ... <page_title> <code>10</code> <value>Page title</value> </page_title> <page_kind> <code>11</code> <value>Z1</value> </page_kind> ... </page_type> <page_data> ... <page_prev> <page_before> <!-- page_ref name and count differs --> <page_ref> <code>62</code> <value1>ABC</value1> <value2>123</value2> <value3>XYZ</value3> ... <!-- A sub group of nodes can appear under here --> <valuex> ... <somevalues>1,2,3</somevalues> <someotherdata>a,b,c</someotherdata> ... </valuex> </page_ref> </page_before> </page_prev> ... </page_data> </page> I believe that effective use of the 'otherwise' processing instruction may save me here. My problem is that the value of 'page_ref/somevalues' could mean that I need to process 'page_title/value' differently. This is part of my problem, the source daata contains a mix of processing insructions alongside the data; which in turn affects part of the data which is in a completely path. I think that by counting expected numbers of nodes and using 'otherwise' I should be able to trap all conditions that should not occur. Thanks, JV |
| Free embeddable forum powered by Nabble | Forum Help |