Hi Scott, Kate,
To test for capitals:
- option 1:
If you use XSLT 2.0 / XPath 2.0 with Schematron then you can use for
example the lower-case() function on the value and compare that with the
original value - if they are not equal then you have capitals.
For example if you use ISO Schematron then you can use xslt2 as
queryBinding to specify that you want XSLT 2.0.
- option 2:
This works also with XSLT 1.0 / XPath 1.0.
You can use the translate function to get the same result as the
lower-case() function, something like below:
translate(value, 'ABC', 'abc')
but instead of ABC and abc you need to put all the possible upper case
and respectively lower case letters that you may have in your document.
Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Scott Hudson wrote:
I'd create a separate schematron file. It should be fairly
straightforward, something like:
<pattern>
<rule context="*...@xml:id]">
<report id="ID_test"
test="contains(string-join(text(),''),'_')"
>xml:id value <value-of select="@xml:id"/> must NOT contain
underscores or capitals as they do not work properly with our build
tools and outputs. </report>
</rule>
</pattern>
I'm not sure about testing for caps, but you may want to visit
http://schematron.com for more details.
Best regards,
--Scott
Hi Scott,
Thanks for the suggestion. Should I be creating a separate schematron
file or
can I edit the schematron that is included in docbook?
And can you recommend a good schematron primer?
Thanks again,
Kate
*Scott Hudson <[email protected]>*
04/23/2009 02:27 PM
To
"[email protected]" <[email protected]>
cc
"[email protected]" <[email protected]>
Subject
Re: [docbook] A way to restrict the content in xml:id
Hi Kate,
not via the DTD, but you could run a schematron validation as a
pre-submission check before the content is sent to the build tools?
HTH,
--Scott
Scott Hudson
Senior XML Architect
e: [email protected]
O: 303.542.2146
C: 303.332.1883
F: 303.544.0522
http://www.FlatironsSolutions.com
Vision. Experience. Engineering Excellence.
[email protected] wrote:
>
> Is there a way to restrict what type of characters are allowed
within an
> xml:id via the DTD?
> We have discovered that if our ids have underscores or capitals that
> they do not work properly with our build tools
> and outputs.
>
> Thanks,
> Kate
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]