Re: [xslt] Pull request : xsltproc --fileparam



On 17/01/2018 18:11, Edouard Tisserant wrote:
Mainly to be able to import files/string that contain a random mix of
double and simple quotes.

xsltproc --stringparam paramname "a\"b'c"

I have no idea why xsltproc disallows mixing of single and double quotes in stringparams. This makes no sense to me and should definitely be changed.

It worked fine (just a bit slow) on Firefox's Transformiix. JS xslt
interface allows passing freely any types as parameters, including huge
strings and even node sets.

The C API and most language bindings should allow this as well.

(what about a --xmlfileparam for xsltproc ?)

I'd suggest to pass a filename as normal parameter and use the `document` function to read the XML document.

I'd like to get the parser working on libxslt too. Unfortunately, it
relies on exslt:regex. I'll try implement exslt:regex on my repo... stay
tuned ;)

This sounds useful, but the big question is which regex flavor to use. The EXSLT spec vaguely mentions "Javascript regular expression syntax" without a specific version or standard document. IMO, it makes more sense to reuse the regex implementation of libxml2 which seems to be based on XML Schema and should be more aligned with XPath 2.0.

Any known previous attempt ?

Not that I know of recently, although there might have been attempts in the past.

Any recommendation before I start ? Looks
like a tab/space hell in there... What should be the rule ?

Yes, it's a wild mix of tabs and spaces. Personally, I prefer spaces.

Nick


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]