LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   XSLT/xml enforcing full tag syntax (https://www.linuxquestions.org/questions/programming-9/xslt-xml-enforcing-full-tag-syntax-385475/)

bigearsbilly 11-22-2005 08:13 AM

XSLT/xml enforcing full tag syntax
 
Hello there,
does anyone know if in XSL you can coerce abbreviated tag
closures to the long form.

e.g: so that...

<element attribute="blah" />

becomes:

<element attribute="blah"></element>

nadroj 11-22-2005 02:48 PM

when using a DTD i believe you can have an element required.
could this be solved with an if/else-like statement? you can use <xsl:when>... elements to test whether the data was given or not.
what you are trying to do is to require that the element contains data (not just attributes)
ie
<product id="34" />
doesnt supply CDATA.. only the attributes

while
<product id="34">Cheese</product>
gives data to the element, along with an attribute.

(dunno where i was going with this, sorry lol)

i think maybe using a DTD making the element of type DATA and #REQUIRED.
my thoughts

bigearsbilly 11-23-2005 02:38 AM

no actually, I am trying to process in perl.
I have > 600 big XML files. > 7 million lines.
Using saxon Xquery it is is veryslow even to
extract a simple query. Plus it uses about
20MegaGigaBugga bytes for each file.

So i am trying a perl method, which is much quicker.
And it would just be easier if all tags were closed off properly.


All times are GMT -5. The time now is 10:50 PM.