unnecessary error for <userinput>

Oxygen general issues.
bwalsh
Posts: 3
Joined: Tue Oct 25, 2011 1:31 pm

unnecessary error for <userinput>

Post by bwalsh »

I could be wrong, but the example below shows what I think is an unnecessary error.
(The text below is cut down from a larger document.)

<section> is a valid parent for <userinput> in XML, so it doesn't need to be within a <para>. Yet the <userinput> text is flagged as an error.


<chapter xmlns="http://docbook.org/ns/docbook" version="5.0"
xmlns:xlink="http://www.w3.org/1999/xlink" >

<title>On Windows</title>
<section>
<title>On Windows</title>
<para>From a console window, change to ....</para>

<userinput>cd [install_dir]</userinput>

<para>
where ...
</para>

<para>Then type:

<userinput>bin\blah.bat</userinput></para>
</section>
</chapter>

This error is only flagged sometimes (particularly with nested sections) - the example below doesn't flag an error, so I think this is an problem with oXygen.

<section>
<title>On Windows</title>
<para>From a console window, change to ....</para>

<userinput>cd [install_dir]</userinput>

<para>
where ...
</para>

<para>Then type:

<userinput>bin\blah.bat</userinput></para>
</section>
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: unnecessary error for <userinput>

Post by Radu »

Hi,

According to the Docbook 5 specification for userinput:

http://www.docbook.org/tdg5/en/html/userinput.html

it can occur in the following elements:
These elements contain userinput: bridgehead, caption (db.html.caption), citation, citetitle, classsynopsisinfo, computeroutput, emphasis (db.emphasis), entry, firstterm, funcsynopsisinfo, glosssee, glossseealso, glossterm, link, literallayout, member, olink, orgdiv, para, phrase (db.phrase), primary, primaryie, programlisting, quote, refdescriptor, refentrytitle, refname, refpurpose, screen, secondary, secondaryie, see, seealso, seealsoie, seeie, seg, segtitle, simpara, subtitle, synopsis, td, term, termdef, tertiary, tertiaryie, th, title, titleabbrev, tocentry, userinput.
I tested both examples and they are both (correctly) flagged as errors when the userinput is directly inside the section.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
bwalsh
Posts: 3
Joined: Tue Oct 25, 2011 1:31 pm

Re: unnecessary error for <userinput>

Post by bwalsh »

hi Radu,

apologies, yes, you are correct that this should be an error, and that is the main point.

However, I was cutting down large text where sometimes it was an error, and sometimes it wasn't. If you put the following text into an standalone file, the error isn't shown. I know this may be too small a sample, so that may be the reason in this case.

<?xml version="1.0" encoding="UTF-8"?>
<section>
<title>On Windows</title>
<para>From a console window, change to ....</para>

<userinput>cd [install_dir]</userinput>

<para>
where ...
</para>

</section>
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: unnecessary error for <userinput>

Post by Radu »

Hi,

When an XML is opened/changed in Oxygen, Oxygen needs somehow to detect what type of vocabulary to use for validation (Docbook 4, 5, TEI, XHTML, DITA, etc).

If the XML does not explicitly specify a reference to a schema then Oxygen has special rules (located in the Document Type Association Preferences page) to determine what kind of vocabulary to use for validation.

A correct Docbook 5 section XML fragment should have had the Docbook 5 namespace declared on the root element like:

Code: Select all

<section xmlns="http://docbook.org/ns/docbook">....
For Docbook 5 for example Oxygen looks that the XML fragment is in the Docbook 5 namespace in order to use the Docbook 5 schema for validation.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
bwalsh
Posts: 3
Joined: Tue Oct 25, 2011 1:31 pm

Re: unnecessary error for <userinput>

Post by bwalsh »

ok, that makes sense.

Please close this for now, if I find another sample, I'll reopen it, but consider this solved.

thanks,
Bridget
Post Reply