Re: [docbook-apps] Catalog setup issues in using MathML entity sets (was Re: Should xmllint successfully validate docbook 5 containing XIncludes?)
Hi Jon, A command line can reference more than one XML catalog, so you could add your own catalog for the entities. But if you cannot alter the processing command or catalogs, then shipping the entity files and using local references will certainly work and be simple enough to debug. To simplify the DOCTYPE of your documents, I would suggest creating a single system entity file that references all the iso entity files with relative file references. That way your DOCTYPE only need to refer to a single file. Bob Stayton Sagehill Enterprises b...@sagehill.net -- From: Jon Leech j...@alumni.caltech.edu Sent: Thursday, October 31, 2013 11:28 PM To: docbook-apps@lists.oasis-open.org Subject: [docbook-apps] Catalog setup issues in using MathML entity sets (was Re: Should xmllint successfully validate docbook 5 containing XIncludes?) On 10/31/2013 09:36 AM, Bob Stayton wrote: Hi Jon, I think Carlos meant to use the official MathML namespace instead of a DTD reference: xmlns:mathml=http://www.w3.org/1998/Math/MathML; It seems loading the MathML DTD confused Jing. The DocBook 5 RelaxNG schema permits elements in the MathML namespace, but it does not try to validate them. But it seems your problem is recognizing the named character entities in the MathML DTD. If Jing does not like loading the entire MathML DTD as you tried, it would probably accept loading just the entity declarations from the DTD. You could try copying the MathML dtd to another file and stripping out all *but* the entity declarations. Those are conveniently located at the end of the DTD file. Then reference that file in the parameter entity in the DOCTYPE to load those entities. Then Jing should validate against the DocBook 5 RNG schema. If you also want to validate the embedded MathML elements, you will need a validator compatible with NVDL such as oNVDL ( http://www.oxygenxml.com/onvdl.html ). Thanks very much Bob, and Carlos. This is very helpful. If I load just the four entity declarations I require, jing validates my DB5 source without hanging. However, I then ran into an issue with the catalog setup. My system's XML catalog (which includes whatever the Debian docbook and mathml packages I have installed put there) contains the identifiers for mathml2.dtd. Loading that also pulls in the co-resident local copies of the entity sets I need from http://www.w3.org/TR/xml-entity-names/#sets But I'm no longer loading mathml2.dtd due to the aforementioned problems with jing, and neither the public nor system identifiers corresponding to the specific entity sets I require are in my XML catalog. So when I try to include them individually in my documents, with a doctype prolog such as !DOCTYPE refentry [ !ENTITY % isoamsc PUBLIC -//W3C//ENTITIES Added Math Symbols: Delimiters//EN//XML http://www.w3.org/2003/entities/2007/isoamsc.ent; ] they aren't found (unless I allow the processor to fetch them from the net, which is of course very slow). Short of tweaking the system XML catalog setup, which is not something I can expect all of the people who will be using my documents to understand or want to do, distributing copies of the entity sets bundled with my Docbook source seems like the simplest way forward. Would you agree, or am I missing some straightforward way (not requiring root access, not OS-specific) to make XML lookups for these specific entity sets check in the same place as mathml2.dtd, even though their identifiers aren't in the system XML catalog? Jon Leech - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] Possible problem with typed indexes
I just tried to use the type facility with indexes for the first time, and I got a strange result. I have indexterms with type=author and indexterms with no type attribute. E.g., indexterm type=authorprimaryShakespeare, William/primary/indexterm I inserted two index tags, one with type=author and one without. The one with author has a title. E.g., index type=authortitleAuthors/title/index index/ I get two indexes, but they are identical except for the title. That is, all of the terms, regardless of type, are in both indexes. I expected to get one complete index and one index with only the terms that have type=author. Has anyone else run into this? Am I doing something wrong, or is this a bug in the stylesheets (I'm using 1.78.1). Best regards, Dick Hamilton --- XML Press XML for Technical Communicators http://xmlpress.net hamil...@xmlpress.net - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] Unwanted xmlns= inserted by xsl-ns customization layer
I'm attempting to customize http://docbook.sourceforge.net/release/xsl-ns/current/xhtml5/onechunk.xsl to insert MathJax script elements in the head of my output documents, by defining the user.head.content template to include my script elements: xsl:template name=user.head.content exclude-result-prefixes= script type=text/x-mathjax-config MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); /script script type=text/javascript src=http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML; /script /xsl:template This does output the script tags when put through xsltproc (and also echoes part of the generated document to stdout for reasons I'm unclear on, but that's a separate weird thing). The problem is that it also adds an unwanted xmlns= attribute in the output elements: script xmlns= type=text/x-mathjax-config MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); /script script xmlns= type=text/javascript src=http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML/ The xmlns= then prevents the MathJax scripts from executing correctly. I am trying to figure out how to suppress it. Adding exclude-result-prefixes= to the xsl:stylesheet element of my customization layer changes nothing. This kind of makes sense, since the attribute says it takes a whitespace-separated list of names, while the name I'm trying to suppress is the empty string. But that seems to be the extent of the control available over namespaces in the output, so I'm at a loss now. I've attached a test document and stylesheet that behave as described when run with the xsl-ns stylesheets rev 1.78.1 and xsltproc --nonet --xinclude test.xsl test.db I'm guessing I've run into some sort of conceptual misunderstanding of how XSLT treats namespaces, but haven't been able to find the right documentation to clear it up, yet. Thanks, Jon Leech refentry xmlns=http://docbook.org/ns/docbook; version=5.0 xml:id=test refmeta refentrytitlegltest/refentrytitle manvolnum3G/manvolnum /refmeta refnamediv refnamegltest/refname refpurposeset the viewport/refpurpose /refnamediv refsynopsisdiv funcsynopsis funcprototype funcdefvoid functionglTest/function/funcdef paramdefGLint parameterx/parameter/paramdef /funcprototype /funcsynopsis /refsynopsisdiv /refentry test.xsl Description: application/xslt - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Unwanted xmlns= inserted by xsl-ns customization layer
On 11/04/2013 05:49 PM, Jon Leech wrote: This does output the script tags when put through xsltproc (and also echoes part of the generated document to stdout for reasons I'm unclear on, but that's a separate weird thing). The problem is that it also adds an unwanted xmlns= attribute in the output elements: Partly answering my own question: after some semi-guesswork pattern-matching I discovered that if I add xmlns=http://www.w3.org/1999/xhtml; to the script elements in my test.xsl, the generated script elements have no namespace. I even sort of understand why this happens now. Still no idea why xsltproc is echoing part of my generated .xhtml file to stdout, though. I assume something in the stylesheet is actually responsible for this. Jon Leech - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Possible problem with typed indexes
Richard, Do you have index.on.type set to 1? Also, the terms appearing in the specialized index will also appear in the general index - it's just a subset. Dave On 05-11-13 12:40 PM, Richard Hamilton wrote: I just tried to use the type facility with indexes for the first time, and I got a strange result. I have indexterms with type=author and indexterms with no type attribute. E.g., indexterm type=authorprimaryShakespeare, William/primary/indexterm I inserted two index tags, one with type=author and one without. The one with author has a title. E.g., index type=authortitleAuthors/title/index index/ I get two indexes, but they are identical except for the title. That is, all of the terms, regardless of type, are in both indexes. I expected to get one complete index and one index with only the terms that have type=author. Has anyone else run into this? Am I doing something wrong, or is this a bug in the stylesheets (I'm using 1.78.1). Best regards, Dick Hamilton --- XML Press XML for Technical Communicators http://xmlpress.net hamil...@xmlpress.net - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org -- *Dave Gardiner*
Re: [docbook-apps] Unwanted xmlns= inserted by xsl-ns customization layer
On Monday, November 04, 2013 06:35:06 PM Jon Leech wrote: On 11/04/2013 05:49 PM, Jon Leech wrote: This does output the script tags when put through xsltproc (and also echoes part of the generated document to stdout for reasons I'm unclear on, but that's a separate weird thing). The problem is that it also adds an unwanted xmlns= attribute in the output elements: Partly answering my own question: after some semi-guesswork pattern-matching I discovered that if I add xmlns=http://www.w3.org/1999/xhtml; to the script elements in my test.xsl, the generated script elements have no namespace. I even sort of understand why this happens now. Still no idea why xsltproc is echoing part of my generated .xhtml file to stdout, though. I assume something in the stylesheet is actually responsible for this. Not exactly. The namespaces in XML are identified by URI, not by prefix. In other words, the same prefix (an empty prefix in your case) can refer to different URIs in different XML documents. Thus, the stylesheet you're customizing declares empty (default) namespace prefix to point to http://www.w3.org/1999/xhtml URI. When you add a customization layer, you didn't specify the prefix for the default namespace, so XSLT processor assumed the script/ element belongs to a namespace with no URI. As its parent element had default namespace pointing to a different URI, it redeclared the default namespace for script/ to an empty string. You can add the xmlns=http://www.w3.org/1999/xhtml; declaration to the xsl:stylesheet/ element in your customization layer to avoid declaring it on each element. Regards, Alexey. Jon Leech - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org