I have a XML passing to the XSL which gives the standard output. There is chance that i will get the XML as empty some times based on some cases. Is there any way if we have empty XML and get the standard or default out put in XSL ?
相关问题
- Illegal to have multiple roots (start tag in epilo
- Newtonsoft DeserializeXNode expands internal array
- how to use special characters like '<'
- XML - XSLT - document() function inside count() fu
- convert logback.xml to log4j.properties
相关文章
- Creating XML Elements without namespace declaratio
- Get Attribute Value From Simple XML Using JQuery /
- Directly signing an Office Word document using XML
- When sending XML to JMS should I use TextMessage o
- Fragment Content Overlaps Toolbar and Bottom Navig
- Getting “Error: Missing Constraints in ConstraintL
- xslt localization
- Upgrading transaction.commit_manually() to Django
One way is to check whether the root node exists in XSL and if not print something out.
But when i tried tsimiliar thin in Perl the script hung.So i think you have to check size and then apply the XSL
You can never have "empty XML".
By definition, a well-formed XML document must have a top element. If an XSLT 1.0 transformation is being applied on any non-well-formed XML document, any compliant XSLT 1.0 processor must produce an error and no processing is done.
If your root tag is an empty node set something should work like this...
... If the file is empty (or at least doesn't contain a root element) your XSLT processor will most likely throw and exception.
From http://www.w3.org/TR/xpath-functions/#func-doc-available
And from http://www.w3.org/TR/xpath-functions/#func-doc
So, it looks like you could do this (I'm being cautious because of the words "One possible processing model"): This stylesheet:
With any input and
B.xml
been an empty document, Saxon output:And this alternate information:
Altova Output: