DesignLiquido / xslt-processor

A JavaScript XSLT processor without native library dependencies
GNU Lesser General Public License v3.0
95 stars 30 forks source link

Allow non-defined attributes #4

Closed adelriosantiago closed 5 years ago

adelriosantiago commented 5 years ago

I'm looking for a way to allow empty attributes, for example, with the XML input:

<v-btn small color="info">Info</v-btn>

After processing with outXmlString = xsltProcess(xml, xslt);

The value of outXmlString will only be:

<v-btn color="info">Info</v-btn>

The small attribute is gone because it was not defined like small="true". However non-defined attributes is the standard on VUE.js (I'm using this to parse VUE components).

Is there a way to allow non-defined attributes?

johanneswilm commented 5 years ago

@adelriosantiago This seems like a general question about XSLT processing? Maybe try to ask in a relevant XML/XSLT forum about that.

johanneswilm commented 5 years ago

@adelriosantiago It looks like that is invalid XML: https://stackoverflow.com/questions/6926442/is-an-xml-attribute-without-a-value-valid

I don't know VUE.js and I cannot quickly find anything about this on the net. Does it basically mean the same thing as <v-btn small="" color="info">Info</v-btn>? If so, we may be able to make it read it like that. Please reopen if you are interested in that.