From ab9fc2379cf3e69cdf5d17e29bda031b3ac15ec6 Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Fri, 5 Jun 2015 23:18:31 +0200 Subject: [PATCH] Better explanation (hopefully!) --- Doc/Sda1/dom.xml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Doc/Sda1/dom.xml b/Doc/Sda1/dom.xml index 112d35bb9..5f31d93fb 100644 --- a/Doc/Sda1/dom.xml +++ b/Doc/Sda1/dom.xml @@ -1193,13 +1193,17 @@ public class CheckUrl { xlink:href="http://www.w3.org/TR/xpath">XPath</acronym> expression:</para> - <programlisting language="none">//html:img[starts-with(@src, 'http://') or starts-with(@src, 'https://') or starts-with(@src, 'ftp://')]</programlisting> - - <para><xref linkend="glo_XHTML"/> Namespace handling is - essential with respect to <acronym - xlink:href="http://www.w3.org/TR/xpath">XPath</acronym> - expressions. We thus define a corresponding namespace prefix - <code>xhtml</code>:</para> + <programlisting language="none">//xhtml:img[starts-with(@src, 'http://') or starts-with(@src, 'https://') or starts-with(@src, 'ftp://')]</programlisting> + + <para> Notice the prefix <quote>xhtml</quote> in the above + <acronym + xlink:href="http://www.w3.org/TR/xpath">XPath</acronym>. + Namespace handling is essential since our elements belong to the + <xref linkend="glo_XHTML"/> namespace. We thus create a + corresponding <classname + xlink:href="http://www.jdom.org/docs/apidocs/org/jdom2/Namespace.html">Namespace</classname> + instance along with the desired <code>xhtml</code> + prefix:</para> <programlisting language="none">final Namespace htmlNamespace = // This will allow for XPath expressions like xhtml:img Namespace.getNamespace("xhtml", "http://www.w3.org/1999/xhtml"); -- GitLab