XSLT not uploading to the DB

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

XSLT not uploading to the DB

Martin Holmes
Hi all,

eXist 3.0 RC1.

I have some XSLT2 files that I'd like to make available from my app for
users to download (as opposed to using them for transformations). When I
try to upload them into an eXist collection, some of them fail to upload
because the use of variable references to set @xml:id attributes like this:

<xsl:variable name="xmlSource">
   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
     <head><xsl:value-of select="$citationCaption"/></head>
        [...]
   <div>
</xsl:variable>

triggers this error:

"The XML parser reported a problem: Value of xml:id attribute is not a
valid NCName: {$thisId}"

Has anyone else come across this problem? Is there a workaround? I could
upload them as text, since in this particular application I'm not doing
XSLT live in the db, but inevitably at some point someone will want to
do this in a working XSLT file.

Cheers,
Martin


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Greg Newton
Same thing happens in RC2:

The XML parser reported a problem: Value of xml:id attribute is not a
valid NCName: APOL2-L{$sectID};

The code that fails:
<xsl:variable name="type" select="./@type"/>
<div xml:id="APOL2-L{$sectID}" type="{$type}">
     <xsl:apply-templates/>
</div>




On 2017-02-06 10:05 AM, Martin Holmes wrote:

> Hi all,
>
> eXist 3.0 RC1.
>
> I have some XSLT2 files that I'd like to make available from my app for
> users to download (as opposed to using them for transformations). When I
> try to upload them into an eXist collection, some of them fail to upload
> because the use of variable references to set @xml:id attributes like this:
>
> <xsl:variable name="xmlSource">
>    <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>      <head><xsl:value-of select="$citationCaption"/></head>
>         [...]
>    <div>
> </xsl:variable>
>
> triggers this error:
>
> "The XML parser reported a problem: Value of xml:id attribute is not a
> valid NCName: {$thisId}"
>
> Has anyone else come across this problem? Is there a workaround? I could
> upload them as text, since in this particular application I'm not doing
> XSLT live in the db, but inevitably at some point someone will want to
> do this in a working XSLT file.
>
> Cheers,
> Martin
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>

=====================================
  Greg Newton
  Programmer/Consultant
  Humanities Computing and Media Centre
  Mearns Centre, Room A316
  University of Victoria
  https://uvic.ca/humanities/hcmc
=====================================

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Hungerburg
Hmm, this is not valid xslt, as far as I can tell; Perhaps its xquery
that, when parsed, produces xslt? From the looks of it, that might make
sense.

xquery BTW is binary - there is an xml representation, but it is mighty
wordy.

Just my 2 cent
Peter

Am 2017-02-06 um 22:39 schrieb Greg Newton:

> Same thing happens in RC2:
>
> The XML parser reported a problem: Value of xml:id attribute is not a
> valid NCName: APOL2-L{$sectID};
>
> The code that fails:
> <xsl:variable name="type" select="./@type"/>
> <div xml:id="APOL2-L{$sectID}" type="{$type}">
>      <xsl:apply-templates/>
> </div>
>
>
>
>
> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>> Hi all,
>>
>> eXist 3.0 RC1.
>>
>> I have some XSLT2 files that I'd like to make available from my app for
>> users to download (as opposed to using them for transformations). When I
>> try to upload them into an eXist collection, some of them fail to upload
>> because the use of variable references to set @xml:id attributes like this:
>>
>> <xsl:variable name="xmlSource">
>>    <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>>      <head><xsl:value-of select="$citationCaption"/></head>
>>         [...]
>>    <div>
>> </xsl:variable>
>>
>> triggers this error:
>>
>> "The XML parser reported a problem: Value of xml:id attribute is not a
>> valid NCName: {$thisId}"
>>
>> Has anyone else come across this problem? Is there a workaround? I could
>> upload them as text, since in this particular application I'm not doing
>> XSLT live in the db, but inevitably at some point someone will want to
>> do this in a working XSLT file.
>>
>> Cheers,
>> Martin
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>
> =====================================
>   Greg Newton
>   Programmer/Consultant
>   Humanities Computing and Media Centre
>   Mearns Centre, Room A316
>   University of Victoria
>   https://uvic.ca/humanities/hcmc
> =====================================
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Patrick Bernaud-3
In reply to this post by Martin Holmes
Hi Martin,

> [...]
> <xsl:variable name="xmlSource">
>   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>     <head><xsl:value-of select="$citationCaption"/></head>
>        [...]
>   <div>
> </xsl:variable>
> [...]
> Has anyone else come across this problem? Is there a workaround?

<xsl:variable name="xmlSource">
  <div type="ajaxFragment" n="{$sortKey}">
    <xsl:attribute name="xml:id"><xsl:value-of select="$thisId"/></xsl:attribute>
    <head><xsl:value-of select="$citationCaption"/></head>
       [...]
  <div>
</xsl:variable>

should work fine.

HTH,

--
Patrick

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Wolfgang Meier-2
In reply to this post by Greg Newton
It’s a common issue which also pops up when you try to upload standard stylesheets like those for TEI. While the output of an xslt transformation should produce correct xml:ids, the attribute constructor in the xslt may not be a valid xml:id in itself and no XML parser complains about it.

I was thus wondering if eXist is too strict: shouldn’t it simply rely on the XML parser to make sure the input is well formed instead of introducing a constraint here?

Wolfgang


> Am 06.02.2017 um 22:39 schrieb Greg Newton <[hidden email]>:
>
> Same thing happens in RC2:
>
> The XML parser reported a problem: Value of xml:id attribute is not a
> valid NCName: APOL2-L{$sectID};
>
> The code that fails:
> <xsl:variable name="type" select="./@type"/>
> <div xml:id="APOL2-L{$sectID}" type="{$type}">
>     <xsl:apply-templates/>
> </div>
>
>
>
>
> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>> Hi all,
>>
>> eXist 3.0 RC1.
>>
>> I have some XSLT2 files that I'd like to make available from my app for
>> users to download (as opposed to using them for transformations). When I
>> try to upload them into an eXist collection, some of them fail to upload
>> because the use of variable references to set @xml:id attributes like this:
>>
>> <xsl:variable name="xmlSource">
>>   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>>     <head><xsl:value-of select="$citationCaption"/></head>
>>        [...]
>>   <div>
>> </xsl:variable>
>>
>> triggers this error:
>>
>> "The XML parser reported a problem: Value of xml:id attribute is not a
>> valid NCName: {$thisId}"
>>
>> Has anyone else come across this problem? Is there a workaround? I could
>> upload them as text, since in this particular application I'm not doing
>> XSLT live in the db, but inevitably at some point someone will want to
>> do this in a working XSLT file.
>>
>> Cheers,
>> Martin
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>
> =====================================
>  Greg Newton
>  Programmer/Consultant
>  Humanities Computing and Media Centre
>  Mearns Centre, Room A316
>  University of Victoria
>  https://uvic.ca/humanities/hcmc
> =====================================
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Jonathan Rowell

What a lovely problem!


https://www.w3.org/TR/xml-id/


but see the second to last note at the end of section 11.13 in this document, which implies that the document Martin is trying to upload is not compliant to the XSLT specification.


https://www.w3.org/TR/xslt20/


Hope that helps a bit


Jonathan




www.w3.org
Abstract. This specification defines the syntax and semantics of XSLT 2.0, a language for transforming XML documents into other XML documents.


www.w3.org
This document defines the meaning of the attribute xml:id as an ID attribute in XML documents and defines processing of this attribute to identify IDs in the absence ...





From: Wolfgang Meier <[hidden email]>
Sent: Tuesday, February 7, 2017 9:25 AM
To: Greg Newton
Cc: [hidden email]
Subject: Re: [Exist-open] XSLT not uploading to the DB
 
It’s a common issue which also pops up when you try to upload standard stylesheets like those for TEI. While the output of an xslt transformation should produce correct xml:ids, the attribute constructor in the xslt may not be a valid xml:id in itself and no XML parser complains about it.

I was thus wondering if eXist is too strict: shouldn’t it simply rely on the XML parser to make sure the input is well formed instead of introducing a constraint here?

Wolfgang


> Am 06.02.2017 um 22:39 schrieb Greg Newton <[hidden email]>:
>
> Same thing happens in RC2:
>
> The XML parser reported a problem: Value of xml:id attribute is not a
> valid NCName: APOL2-L{$sectID};
>
> The code that fails:
> <xsl:variable name="type" select="./@type"/>
> <div xml:id="APOL2-L{$sectID}" type="{$type}">
>     <xsl:apply-templates/>
> </div>
>
>
>
>
> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>> Hi all,
>>
>> eXist 3.0 RC1.
>>
>> I have some XSLT2 files that I'd like to make available from my app for
>> users to download (as opposed to using them for transformations). When I
>> try to upload them into an eXist collection, some of them fail to upload
>> because the use of variable references to set @xml:id attributes like this:
>>
>> <xsl:variable name="xmlSource">
>>   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>>     <head><xsl:value-of select="$citationCaption"/></head>
>>        [...]
>>   <div>
>> </xsl:variable>
>>
>> triggers this error:
>>
>> "The XML parser reported a problem: Value of xml:id attribute is not a
>> valid NCName: {$thisId}"
>>
>> Has anyone else come across this problem? Is there a workaround? I could
>> upload them as text, since in this particular application I'm not doing
>> XSLT live in the db, but inevitably at some point someone will want to
>> do this in a working XSLT file.
>>
>> Cheers,
>> Martin
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.


>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
lists.sourceforge.net
Your email address: Your name (optional): You may enter a privacy password below. This provides only mild security, but should prevent others from messing with ...


>>
>
> =====================================
>  Greg Newton
>  Programmer/Consultant
>  Humanities Computing and Media Centre
>  Mearns Centre, Room A316
>  University of Victoria
https://uvic.ca/humanities/hcmc
> =====================================
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
lists.sourceforge.net
Your email address: Your name (optional): You may enter a privacy password below. This provides only mild security, but should prevent others from messing with ...




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.


_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
lists.sourceforge.net
Your email address: Your name (optional): You may enter a privacy password below. This provides only mild security, but should prevent others from messing with ...



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Joe Wicentowski
In reply to this post by Martin Holmes
Hi Martin and all,

Others have already pointed out the workaround, but your email reminded me of when I reported this issue to Sebastian Rahtz in advance of the seminar I was preparing to give at TEI@Oxford Summer School in 2010 (see exchange below).  

I hadn't considered the possibility Wolfgang suggested that perhaps eXist is being stricter than it needs to be; I wonder what effect relaxing this restriction would have on the functioning of the built-in range index applied to @xml:id attributes?  (See the explanation of this feature at http://exist-db.org/exist/apps/doc/tuning.xml#D2.2.6.12.)

Joe

---------- Forwarded message ----------
From: Sebastian Rahtz <[hidden email]>
Date: Fri, Jul 9, 2010 at 6:25 AM
Subject: Re: oxford summer school
To: Joe Wicentowski <[hidden email]>

>     org.xml.sax.SAXException: Value of xml:id attribute is not a
> valid NCName: {substring(@w:name,2)}
>
> It wouldn't ingest the files until I changed instances of:
>
>     <anchor xml:id="{substring(@w:name,2)}"/>
>
> to:
>
>      <xsl:element name="anchor">
>          <xsl:attribute name="xml:id">
>              <xsl:value-of select="substring(@w:name,2)"/>
>          </xsl:attribute>
>      </xsl:element>

understood. I'll fix those now

---------- Forwarded message ----------
From: Joe Wicentowski <[hidden email]>
Date: Thu, Jul 8, 2010 at 9:44 PM
Subject: Re: oxford summer school
To: Sebastian Rahtz <[hidden email]>

[...]

On a different note, continuing in the spirit of smoothing out rough
edges between eXist and TEI, I wanted to let you know that I found a
way around a problem I had ingesting the TEI stylesheets
(tei-xsl-5.32) into eXist.  eXist was complaining about 2 files, (1)
stylesheet/profiles/iso/docx/from.xsl and (2)
stylesheet/docx/from/pass2/pass2.xsl.  The error upon ingest (copying
into eXist via WebDAV, with validation set to "auto" in eXist's
conf.xml) was:

     org.xml.sax.SAXException: Value of xml:id attribute is not a
valid NCName: {substring(@w:name,2)}

It wouldn't ingest the files until I changed instances of:

     <anchor xml:id="{substring(@w:name,2)}"/>

to:

     <xsl:element name="anchor">
         <xsl:attribute name="xml:id">
             <xsl:value-of select="substring(@w:name,2)"/>
         </xsl:attribute>
     </xsl:element>

I've attached the modified files.  If this isn't too drastic a change,
would you please consider it for these files in the TEI stylesheet
distribution?



On Mon, Feb 6, 2017 at 1:05 PM, Martin Holmes <[hidden email]> wrote:
Hi all,

eXist 3.0 RC1.

I have some XSLT2 files that I'd like to make available from my app for
users to download (as opposed to using them for transformations). When I
try to upload them into an eXist collection, some of them fail to upload
because the use of variable references to set @xml:id attributes like this:

<xsl:variable name="xmlSource">
   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
     <head><xsl:value-of select="$citationCaption"/></head>
        [...]
   <div>
</xsl:variable>

triggers this error:

"The XML parser reported a problem: Value of xml:id attribute is not a
valid NCName: {$thisId}"

Has anyone else come across this problem? Is there a workaround? I could
upload them as text, since in this particular application I'm not doing
XSLT live in the db, but inevitably at some point someone will want to
do this in a working XSLT file.

Cheers,
Martin


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Martin Holmes
In reply to this post by Hungerburg
On 2017-02-06 02:39 PM, Hungerburg wrote:
> Hmm, this is not valid xslt, as far as I can tell; Perhaps its xquery
> that, when parsed, produces xslt? From the looks of it, that might make
> sense.

It's valid XSLT2 as far as I can see. What do you think is wrong with it?

Cheers,
Martin

> xquery BTW is binary - there is an xml representation, but it is mighty
> wordy.
>
> Just my 2 cent
> Peter
>
> Am 2017-02-06 um 22:39 schrieb Greg Newton:
>> Same thing happens in RC2:
>>
>> The XML parser reported a problem: Value of xml:id attribute is not a
>> valid NCName: APOL2-L{$sectID};
>>
>> The code that fails:
>> <xsl:variable name="type" select="./@type"/>
>> <div xml:id="APOL2-L{$sectID}" type="{$type}">
>>      <xsl:apply-templates/>
>> </div>
>>
>>
>>
>>
>> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>>> Hi all,
>>>
>>> eXist 3.0 RC1.
>>>
>>> I have some XSLT2 files that I'd like to make available from my app for
>>> users to download (as opposed to using them for transformations). When I
>>> try to upload them into an eXist collection, some of them fail to upload
>>> because the use of variable references to set @xml:id attributes like this:
>>>
>>> <xsl:variable name="xmlSource">
>>>    <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>>>      <head><xsl:value-of select="$citationCaption"/></head>
>>>         [...]
>>>    <div>
>>> </xsl:variable>
>>>
>>> triggers this error:
>>>
>>> "The XML parser reported a problem: Value of xml:id attribute is not a
>>> valid NCName: {$thisId}"
>>>
>>> Has anyone else come across this problem? Is there a workaround? I could
>>> upload them as text, since in this particular application I'm not doing
>>> XSLT live in the db, but inevitably at some point someone will want to
>>> do this in a working XSLT file.
>>>
>>> Cheers,
>>> Martin
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Exist-open mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>>
>>
>> =====================================
>>   Greg Newton
>>   Programmer/Consultant
>>   Humanities Computing and Media Centre
>>   Mearns Centre, Room A316
>>   University of Victoria
>>   https://uvic.ca/humanities/hcmc
>> =====================================
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Martin Holmes
In reply to this post by Jonathan Rowell
Hi Jonathon,

I must be missing something -- can't find 11.13 in either document!

If it's the case that an attribute constructor in this form is not
allowed for @xml:id because of is-id constraints, then I have a bit of
rewriting to do, but that's fine; it's easy enough to use the more
verbose constructor. I'll ask on the XSLT list.

Cheers,
Martin

On 2017-02-07 04:51 AM, Jonathan Rowell wrote:

> What a lovely problem!
>
>
> https://www.w3.org/TR/xml-id/
>
>
>     but see the second to last note at the end of section 11.13 in this
>     document, which implies that the document Martin is trying to upload
>     is not compliant to the XSLT specification.
>
>
> https://www.w3.org/TR/xslt20/
>
>
> Hope that helps a bit
>
>
> Jonathan
>
>
>
>
> XSL Transformations (XSLT) Version 2.0 <https://www.w3.org/TR/xslt20/>
> www.w3.org
> Abstract. This specification defines the syntax and semantics of XSLT
> 2.0, a language for transforming XML documents into other XML documents.
>
>
>
> xml:id Version 1.0 - World Wide Web Consortium
> <https://www.w3.org/TR/xml-id/>
> www.w3.org
> This document defines the meaning of the attribute xml:id as an ID
> attribute in XML documents and defines processing of this attribute to
> identify IDs in the absence ...
>
>
>
>
>
> ------------------------------------------------------------------------
> *From:* Wolfgang Meier <[hidden email]>
> *Sent:* Tuesday, February 7, 2017 9:25 AM
> *To:* Greg Newton
> *Cc:* [hidden email]
> *Subject:* Re: [Exist-open] XSLT not uploading to the DB
>
> It’s a common issue which also pops up when you try to upload standard
> stylesheets like those for TEI. While the output of an xslt
> transformation should produce correct xml:ids, the attribute constructor
> in the xslt may not be a valid xml:id in itself and no XML parser
> complains about it.
>
> I was thus wondering if eXist is too strict: shouldn’t it simply rely on
> the XML parser to make sure the input is well formed instead of
> introducing a constraint here?
>
> Wolfgang
>
>
>> Am 06.02.2017 um 22:39 schrieb Greg Newton <[hidden email]>:
>>
>> Same thing happens in RC2:
>>
>> The XML parser reported a problem: Value of xml:id attribute is not a
>> valid NCName: APOL2-L{$sectID};
>>
>> The code that fails:
>> <xsl:variable name="type" select="./@type"/>
>> <div xml:id="APOL2-L{$sectID}" type="{$type}">
>>     <xsl:apply-templates/>
>> </div>
>>
>>
>>
>>
>> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>>> Hi all,
>>>
>>> eXist 3.0 RC1.
>>>
>>> I have some XSLT2 files that I'd like to make available from my app for
>>> users to download (as opposed to using them for transformations). When I
>>> try to upload them into an eXist collection, some of them fail to upload
>>> because the use of variable references to set @xml:id attributes like this:
>>>
>>> <xsl:variable name="xmlSource">
>>>   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>>>     <head><xsl:value-of select="$citationCaption"/></head>
>>>        [...]
>>>   <div>
>>> </xsl:variable>
>>>
>>> triggers this error:
>>>
>>> "The XML parser reported a problem: Value of xml:id attribute is not a
>>> valid NCName: {$thisId}"
>>>
>>> Has anyone else come across this problem? Is there a workaround? I could
>>> upload them as text, since in this particular application I'm not doing
>>> XSLT live in the db, but inevitably at some point someone will want to
>>> do this in a working XSLT file.
>>>
>>> Cheers,
>>> Martin
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Slashdot: News for nerds, stuff that matters <http://sdm.link/slashdot>
> sdm.link
> Slashdot: News for nerds, stuff that matters. Timely news source for
> technology related news with a heavy slant towards Linux and Open Source
> issues.
>
>
>
>>> _______________________________________________
>>> Exist-open mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
> Exist-open Info Page - SourceForge
> <https://lists.sourceforge.net/lists/listinfo/exist-open>
> lists.sourceforge.net
> Your email address: Your name (optional): You may enter a privacy
> password below. This provides only mild security, but should prevent
> others from messing with ...
>
>
>
>>>
>>
>> =====================================
>>  Greg Newton
>>  Programmer/Consultant
>>  Humanities Computing and Media Centre
>>  Mearns Centre, Room A316
>>  University of Victoria
>>  https://uvic.ca/humanities/hcmc
>> =====================================
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
> Exist-open Info Page - SourceForge
> <https://lists.sourceforge.net/lists/listinfo/exist-open>
> lists.sourceforge.net
> Your email address: Your name (optional): You may enter a privacy
> password below. This provides only mild security, but should prevent
> others from messing with ...
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Slashdot: News for nerds, stuff that matters <http://sdm.link/slashdot>
> sdm.link
> Slashdot: News for nerds, stuff that matters. Timely news source for
> technology related news with a heavy slant towards Linux and Open Source
> issues.
>
>
>
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
> Exist-open Info Page - SourceForge
> <https://lists.sourceforge.net/lists/listinfo/exist-open>
> lists.sourceforge.net
> Your email address: Your name (optional): You may enter a privacy
> password below. This provides only mild security, but should prevent
> others from messing with ...
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Martin Holmes
Wisdom from Michael Kay:

> This problem is envisaged in the XSLT spec. See §11.1.2:
>
> The xml:base, xml:lang, xml:space, and xml:id attributes have two
> effects in XSLT. They behave as standard XSLT attributes, which means
> for example that if they appear on a literal result element, they
> will be copied to the result tree in the same way as any other
> attribute. In addition, they have their standard meaning as defined
> in the core XML specifications. Thus, an xml:base attribute in the
> stylesheet affects the base URI of the element on which it appears,
> and an xml:space attribute affects the interpretation of whitespace
> text nodes within that element. One consequence of this is that it is
> inadvisable to write these attributes as attribute value templates:
> although an XSLT processor will understand this notation, the XML
> parser will not. See also 11.1.4 Namespace Aliasing which describes
> how to use xsl:namespace-alias with these attributes.

So I don't think my XSLT is wrong but it's definitely ill-advised, and I
shall change my ways forthwith (I have 33 instances of this in the
current project alone). eXist may continue to be strict. And Joe's
similar comments on the TEI Stylesheets should be acted on, if they
haven't already been.

Cheers,
Martin

On 2017-02-07 09:09 AM, Martin Holmes wrote:

> Hi Jonathon,
>
> I must be missing something -- can't find 11.13 in either document!
>
> If it's the case that an attribute constructor in this form is not
> allowed for @xml:id because of is-id constraints, then I have a bit
> of rewriting to do, but that's fine; it's easy enough to use the more
>  verbose constructor. I'll ask on the XSLT list.
>
> Cheers, Martin
>
> On 2017-02-07 04:51 AM, Jonathan Rowell wrote:
>> What a lovely problem!
>>
>>
>> https://www.w3.org/TR/xml-id/
>>
>>
>> but see the second to last note at the end of section 11.13 in
>> this document, which implies that the document Martin is trying to
>> upload is not compliant to the XSLT specification.
>>
>>
>> https://www.w3.org/TR/xslt20/
>>
>>
>> Hope that helps a bit
>>
>>
>> Jonathan
>>
>>
>>
>>
>> XSL Transformations (XSLT) Version 2.0
>> <https://www.w3.org/TR/xslt20/> www.w3.org Abstract. This
>> specification defines the syntax and semantics of XSLT 2.0, a
>> language for transforming XML documents into other XML documents.
>>
>>
>>
>> xml:id Version 1.0 - World Wide Web Consortium
>> <https://www.w3.org/TR/xml-id/> www.w3.org This document defines
>> the meaning of the attribute xml:id as an ID attribute in XML
>> documents and defines processing of this attribute to identify IDs
>> in the absence ...
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
*From:* Wolfgang Meier <[hidden email]>

>> *Sent:* Tuesday, February 7, 2017 9:25 AM *To:* Greg Newton *Cc:*
>> [hidden email] *Subject:* Re: [Exist-open] XSLT
>> not uploading to the DB
>>
>> It’s a common issue which also pops up when you try to upload
>> standard stylesheets like those for TEI. While the output of an
>> xslt transformation should produce correct xml:ids, the attribute
>> constructor in the xslt may not be a valid xml:id in itself and no
>> XML parser complains about it.
>>
>> I was thus wondering if eXist is too strict: shouldn’t it simply
>> rely on the XML parser to make sure the input is well formed
>> instead of introducing a constraint here?
>>
>> Wolfgang
>>
>>
>>> Am 06.02.2017 um 22:39 schrieb Greg Newton <[hidden email]>:
>>>
>>> Same thing happens in RC2:
>>>
>>> The XML parser reported a problem: Value of xml:id attribute is
>>> not a valid NCName: APOL2-L{$sectID};
>>>
>>> The code that fails: <xsl:variable name="type"
>>> select="./@type"/> <div xml:id="APOL2-L{$sectID}"
>>> type="{$type}"> <xsl:apply-templates/> </div>
>>>
>>>
>>>
>>>
>>> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>>>> Hi all,
>>>>
>>>> eXist 3.0 RC1.
>>>>
>>>> I have some XSLT2 files that I'd like to make available from my
>>>> app for users to download (as opposed to using them for
>>>> transformations). When I try to upload them into an eXist
>>>> collection, some of them fail to upload because the use of
>>>> variable references to set @xml:id attributes like this:
>>>>
>>>> <xsl:variable name="xmlSource"> <div type="ajaxFragment"
>>>> xml:id="{$thisId}" n="{$sortKey}"> <head><xsl:value-of
>>>> select="$citationCaption"/></head> [...] <div> </xsl:variable>
>>>>
>>>> triggers this error:
>>>>
>>>> "The XML parser reported a problem: Value of xml:id attribute
>>>> is not a valid NCName: {$thisId}"
>>>>
>>>> Has anyone else come across this problem? Is there a
>>>> workaround? I could upload them as text, since in this
>>>> particular application I'm not doing XSLT live in the db, but
>>>> inevitably at some point someone will want to do this in a
>>>> working XSLT file.
>>>>
>>>> Cheers, Martin
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
Check out the vibrant tech community on one of the world's most

>>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> Slashdot: News for nerds, stuff that matters
>> <http://sdm.link/slashdot> sdm.link Slashdot: News for nerds, stuff
>> that matters. Timely news source for technology related news with a
>> heavy slant towards Linux and Open Source issues.
>>
>>
>>
>>>> _______________________________________________ Exist-open
>>>> mailing list [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>> Exist-open Info Page - SourceForge
>> <https://lists.sourceforge.net/lists/listinfo/exist-open>
>> lists.sourceforge.net Your email address: Your name (optional): You
>> may enter a privacy password below. This provides only mild
>> security, but should prevent others from messing with ...
>>
>>
>>
>>>>
>>>
>>> ===================================== Greg Newton
>>> Programmer/Consultant Humanities Computing and Media Centre
>>> Mearns Centre, Room A316 University of Victoria
>>> https://uvic.ca/humanities/hcmc
>>> =====================================
>>>
>>> ------------------------------------------------------------------------------
>>>
>>>
Check out the vibrant tech community on one of the world's most

>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>> _______________________________________________ Exist-open
>>> mailing list [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
>> Exist-open Info Page - SourceForge
>> <https://lists.sourceforge.net/lists/listinfo/exist-open>
>> lists.sourceforge.net Your email address: Your name (optional): You
>> may enter a privacy password below. This provides only mild
>> security, but should prevent others from messing with ...
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
Check out the vibrant tech community on one of the world's most

>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> Slashdot: News for nerds, stuff that matters
>> <http://sdm.link/slashdot> sdm.link Slashdot: News for nerds, stuff
>> that matters. Timely news source for technology related news with a
>> heavy slant towards Linux and Open Source issues.
>>
>>
>>
>> _______________________________________________ Exist-open mailing
>> list [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open Exist-open
>> Info Page - SourceForge
>> <https://lists.sourceforge.net/lists/listinfo/exist-open>
>> lists.sourceforge.net Your email address: Your name (optional): You
>> may enter a privacy password below. This provides only mild
>> security, but should prevent others from messing with ...
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
Check out the vibrant tech community on one of the world's most

>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>
>>
>>
>> _______________________________________________ Exist-open mailing
>> list [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
>
>
> ------------------------------------------------------------------------------
>
>
Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________ Exist-open mailing
> list [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSLT not uploading to the DB

Jonathan Rowell
In reply to this post by Martin Holmes

Hi Martin,


sorry my bad. A dot was missing. 11.1.3 I ought to have posted a full link, because in fact it is 11.1.2 


https://www.w3.org/TR/xslt20/#attributes-for-lres

www.w3.org
Abstract. This specification defines the syntax and semantics of XSLT 2.0, a language for transforming XML documents into other XML documents.
Jonathan




From: Martin Holmes <[hidden email]>
Sent: Tuesday, February 7, 2017 5:09 PM
To: [hidden email]
Subject: Re: [Exist-open] XSLT not uploading to the DB
 
Hi Jonathon,

I must be missing something -- can't find 11.13 in either document!

If it's the case that an attribute constructor in this form is not
allowed for @xml:id because of is-id constraints, then I have a bit of
rewriting to do, but that's fine; it's easy enough to use the more
verbose constructor. I'll ask on the XSLT list.

Cheers,
Martin

On 2017-02-07 04:51 AM, Jonathan Rowell wrote:
> What a lovely problem!
>
>
> https://www.w3.org/TR/xml-id/
www.w3.org
This document defines the meaning of the attribute xml:id as an ID attribute in XML documents and defines processing of this attribute to identify IDs in the absence ...


>
>
>     but see the second to last note at the end of section 11.13 in this
>     document, which implies that the document Martin is trying to upload
>     is not compliant to the XSLT specification.
>
>
> https://www.w3.org/TR/xslt20/
www.w3.org
Abstract. This specification defines the syntax and semantics of XSLT 2.0, a language for transforming XML documents into other XML documents.


>
>
> Hope that helps a bit
>
>
> Jonathan
>
>
>
>
> XSL Transformations (XSLT) Version 2.0 <https://www.w3.org/TR/xslt20/>
www.w3.org
Abstract. This specification defines the syntax and semantics of XSLT 2.0, a language for transforming XML documents into other XML documents.


> www.w3.org
> Abstract. This specification defines the syntax and semantics of XSLT
> 2.0, a language for transforming XML documents into other XML documents.
>
>
>
> xml:id Version 1.0 - World Wide Web Consortium
> <https://www.w3.org/TR/xml-id/>
www.w3.org
This document defines the meaning of the attribute xml:id as an ID attribute in XML documents and defines processing of this attribute to identify IDs in the absence ...


> www.w3.org
> This document defines the meaning of the attribute xml:id as an ID
> attribute in XML documents and defines processing of this attribute to
> identify IDs in the absence ...
>
>
>
>
>
> ------------------------------------------------------------------------
> *From:* Wolfgang Meier <[hidden email]>
> *Sent:* Tuesday, February 7, 2017 9:25 AM
> *To:* Greg Newton
> *Cc:* [hidden email]
> *Subject:* Re: [Exist-open] XSLT not uploading to the DB
>
> It’s a common issue which also pops up when you try to upload standard
> stylesheets like those for TEI. While the output of an xslt
> transformation should produce correct xml:ids, the attribute constructor
> in the xslt may not be a valid xml:id in itself and no XML parser
> complains about it.
>
> I was thus wondering if eXist is too strict: shouldn’t it simply rely on
> the XML parser to make sure the input is well formed instead of
> introducing a constraint here?
>
> Wolfgang
>
>
>> Am 06.02.2017 um 22:39 schrieb Greg Newton <[hidden email]>:
>>
>> Same thing happens in RC2:
>>
>> The XML parser reported a problem: Value of xml:id attribute is not a
>> valid NCName: APOL2-L{$sectID};
>>
>> The code that fails:
>> <xsl:variable name="type" select="./@type"/>
>> <div xml:id="APOL2-L{$sectID}" type="{$type}">
>>     <xsl:apply-templates/>
>> </div>
>>
>>
>>
>>
>> On 2017-02-06 10:05 AM, Martin Holmes wrote:
>>> Hi all,
>>>
>>> eXist 3.0 RC1.
>>>
>>> I have some XSLT2 files that I'd like to make available from my app for
>>> users to download (as opposed to using them for transformations). When I
>>> try to upload them into an eXist collection, some of them fail to upload
>>> because the use of variable references to set @xml:id attributes like this:
>>>
>>> <xsl:variable name="xmlSource">
>>>   <div type="ajaxFragment" xml:id="{$thisId}" n="{$sortKey}">
>>>     <head><xsl:value-of select="$citationCaption"/></head>
>>>        [...]
>>>   <div>
>>> </xsl:variable>
>>>
>>> triggers this error:
>>>
>>> "The XML parser reported a problem: Value of xml:id attribute is not a
>>> valid NCName: {$thisId}"
>>>
>>> Has anyone else come across this problem? Is there a workaround? I could
>>> upload them as text, since in this particular application I'm not doing
>>> XSLT live in the db, but inevitably at some point someone will want to
>>> do this in a working XSLT file.
>>>
>>> Cheers,
>>> Martin
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.


> Slashdot: News for nerds, stuff that matters <http://sdm.link/slashdot>
sdm.link
Slashdot: News for nerds, stuff that matters. Timely news source for technology related news with a heavy slant towards Linux and Open Source issues.


> sdm.link
> Slashdot: News for nerds, stuff that matters. Timely news source for
> technology related news with a heavy slant towards Linux and Open Source
> issues.
>
>
>
>>> _______________________________________________
>>> Exist-open mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/exist-open
lists.sourceforge.net
Your email address: Your name (optional): You may enter a privacy password below. This provides only mild security, but should prevent others from messing with ...


> Exist-open Info Page - SourceForge
> <https://lists.sourceforge.net/lists/listinfo/exist-open>
lists.sourceforge.net
Your email address: Your name (optional): You may enter a privacy password below. This provides only mild security, but should prevent others from messing with ...


> lists.sourceforge.net
> Your email address: Your name (optional): You may enter a privacy
> password below. This provides only mild security, but should prevent
> others from messing with ...
>
>
>
>>>
>>
>> =====================================
>>  Greg Newton
>>  Programmer/Consultant
>>  Humanities Computing and Media Centre
>>  Mearns Centre, Room A316
>>  University of Victoria
>>  https://uvic.ca/humanities/hcmc
>> =====================================
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Exist-open mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/exist-open
> Exist-open Info Page - SourceForge
> <https://lists.sourceforge.net/lists/listinfo/exist-open>
> lists.sourceforge.net
> Your email address: Your name (optional): You may enter a privacy
> password below. This provides only mild security, but should prevent
> others from messing with ...
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> Slashdot: News for nerds, stuff that matters <http://sdm.link/slashdot>
> sdm.link
> Slashdot: News for nerds, stuff that matters. Timely news source for
> technology related news with a heavy slant towards Linux and Open Source
> issues.
>
>
>
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open
> Exist-open Info Page - SourceForge
> <https://lists.sourceforge.net/lists/listinfo/exist-open>
> lists.sourceforge.net
> Your email address: Your name (optional): You may enter a privacy
> password below. This provides only mild security, but should prevent
> others from messing with ...
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>
>
>
> _______________________________________________
> Exist-open mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...