Hi
I upgraded my GN 2.4.3 to GN 2.10.3 and ran into an Schematron issue where I use the ‘document’ function, e.g. document(‘MyFile.xml’) - where the file was placed in the same root schema folder (*/schema_plugins/iso19139’) as the ‘schematron-rules-X.xsl’ file that was compiled from the ‘schematron-rules-X.sch’ file.
Now that the *.sch and *.xsl files sit in a ‘Schematron’ subfolder I ran into problem where I get an error: ‘A sequence of more than one item is not allowed as the first argument of normalize-space() (“”, “”, …)’
The Schematron snippet is the following:
<sch:assert test=“document(‘MyFile.xml’)//*[normalize-space(text()) = $keyWordSupplied ]”>
<sch:value-of select=“$loc/strings/alert.M12111x/div”/>
</sch:assert>
The exact same schematron worked in 2.4.3.
Am I correct that the file is found, but the error is rather caused by the [normalize-space(text()) bit?
Any advice please? Would be much appreciated
Regards, Gert
The error:
‘A sequence of more than one item is not allowed as the first argument of normalize-space() (“”, “”, …)’
usually means that the selector has found multiple matches. Looking at the code it doesn’t seem like it should be the fault of document(). Rather the call to text() is matching multiple text elements. You need to select one of the text elements instead of selecting all of them.
I am not sure if it works but you could try:
text()[normalize-space(.) != ‘’)
Jesse
···
On Thu, Apr 10, 2014 at 11:41 PM, Gert Conradie <gert.conradie@anonymised.com> wrote:
Hi
I upgraded my GN 2.4.3 to GN 2.10.3 and ran into an Schematron issue where I use the ‘document’ function, e.g. document(‘MyFile.xml’) - where the file was placed in the same root schema folder (*/schema_plugins/iso19139’) as the ‘schematron-rules-X.xsl’ file that was compiled from the ‘schematron-rules-X.sch’ file.
Now that the *.sch and *.xsl files sit in a ‘Schematron’ subfolder I ran into problem where I get an error: ‘A sequence of more than one item is not allowed as the first argument of normalize-space() (“”, “”, …)’
The Schematron snippet is the following:
<sch:assert test=“document(‘MyFile.xml’)//*[normalize-space(text()) = $keyWordSupplied ]”>
<sch:value-of select=“$loc/strings/alert.M12111x/div”/>
</sch:assert>
The exact same schematron worked in 2.4.3.
Am I correct that the file is found, but the error is rather caused by the [normalize-space(text()) bit?
Any advice please? Would be much appreciated
Regards, Gert
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork