[oXygen-user] Feature request: Validation for linked images in SVG paths

KAATMAN Matthew matthew.kaatman at biomerieux.com
Tue Jul 30 07:33:28 CDT 2013


Hey Alex,

This looks really promising!

When I run validate with this schematron I get the following:

System ID: C:\svn\scripts\svgCheck.sch
Engine name: ISO Schematron (XSLT 2.0)
Severity: fatal
Type: XML validation
Start location: 149:0 (Odd because the schematron is only 14 lines)

System ID: C:\dita\pt\products\vitek2systems\pi\Appendix_A.dita (This is the first file with an SVG for the document I checked.)
Engine name: ISO Schematron (XSLT 2.0)
Severity: error
Description: Exception thrown by extension function {public static boolean com.saxonica.functions.extfn.EXPathFile.exists(java.lang.String)}: java.lang.NullPointerException
Type: XML validation

Even if I delete all SVG references, I receive the above two errors.

I then tried it on a map with more SVGs and some that were verified to be broken. It is properly detecting the errors but I see false positives when the SVG contains embedded images instead of linked. I believe it's trying to verify the binary data as the uri.

System ID: C:\dita\en\products\simon\service\Attachments.dita
Engine name: ISO Schematron (XSLT 2.0)
Severity: error
Description: A sequence of more than one item is not allowed as the first argument of resolve-uri() ("data:image/jpeg;base64,/9j/4AA...", "data:image/png;base64,iVBORw0K...")
Type: XML validation

Is there a way for me to adjust the schematron to ignore href values that start with "data"?

I had previously attended a webinar Oxygen presented on schematron. I'm finally starting to understand how powerful it can be!

Thank you,
Matt


From: oxygen-user-bounces at oxygenxml.com [mailto:oxygen-user-bounces at oxygenxml.com] On Behalf Of Alex Jitianu
Sent: Tuesday, July 30, 2013 2:25 AM
To: oxygen-user at oxygenxml.com
Subject: Re: [oXygen-user] Feature request: Validation for linked images in SVG paths

Hello  Matt,

In Oxygen v15.0 we've added in the "Validate and check for Completeness" dialog a new entry called "Additional schematron checks" in which you can specify additional Schematron checks that should be be executed on the topics. You can perform the check you've described using a Schematron file with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<schema
    xmlns="http://purl.oclc.org/dsdl/schematron"<http://purl.oclc.org/dsdl/schematron>
    queryBinding="xslt2"
    xmlns:exslt="http://expath.org/ns/file"<http://expath.org/ns/file>>
    <ns uri="http://expath.org/ns/file"<http://expath.org/ns/file> prefix="exslt"/>
    <pattern>
        <rule context="image[ends-with(@href, '.svg')]"<mailto:image[ends-with(@href,'.svg')]>>
            <let name="svgDocument" value="document(@href)" />
            <assert test="exslt:exists(resolve-uri($svgDocument//*:image/@*:href, base-uri($svgDocument)))">
                The image file from the following SVG doesn't exist: <value-of select="base-uri($svgDocument)"/></assert>
        </rule>
    </pattern>
</schema>

Best regards,
Alex
--
Alex Jitianu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


On 29-Jul-13 9:38 PM, KAATMAN Matthew wrote:

Hey Guys,



This is a feature request that's not extremely crucial, but it would be helpful for us.



I'm having our authors create SVG overlays and link to the background image (jpeg or png).



Sometimes they accidentally link to an image that isn't in our repository path.



Within the SVG, I'll end up with something like:

<image width="1200" height="1807" xlink:href="../../../../../../../Users/Username/Pictures/PREVI PAV/PAV_printer_cover_open.jpg"  >



When it should be:

<image width="1200" height="1807" xlink:href="images/PAV_printer_cover_open.jpg"  >



Although, the validate/check for completeness wouldn't catch this on their workstation as the image exists and is valid, it would find it quickly on mine since it's outside the path that gets checked in and I'd be missing that image.



It doesn't seem like the OT throws any errors either. The only way I find out is when I'm viewing the PDF and notice that antenna house has substituted a broken image.



Example:

[cid:image001.png at 01CE8CF5.2C3637F0]



Thanks!
Matt
AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.



_______________________________________________

oXygen-user mailing list

oXygen-user at oxygenxml.com<mailto:oXygen-user at oxygenxml.com>

http://www.oxygenxml.com/mailman/listinfo/oxygen-user


AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes.
NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20130730/3e492227/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 8037 bytes
Desc: image001.png
Url : http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20130730/3e492227/attachment-0001.png 


More information about the oXygen-user mailing list