Re: XML Editor

"Brian Heilig" <Brian.Heilig-tdt4z+Mb/[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <[email protected]>
 Berend de Boer wrote:

> Emacs is the answer

I have emacs set up for syntax hilighting and tags. Thanks Berend, 
Andreas, and Grant for your work. I'm having trouble getting the XML 
portion to work correctly. I will probably get it working, but I 
wanted to give you some feedback from a newbie user.

I installed nxml as you suggest on your page. Emacs is now set up for 
editing XML files. However I've had some bad luck getting Emacs to 
load the schema.

It says in the readme that nxml doesn't support RNG, but it does 
support RNC. So I need to convert gobo.rng to gobo.rnc. At first I 
tried to use gexslt for that. I downloaded RngToRnc 1.4. The readme 
for RngToRnc says:

  "If your XSLT processor supports the exslt:node-set () function [3]
   or similar, then a translation can be done by a single invocation
   of either RngToRncHtml.xsl or RngToRncText.xsl."

I have no idea what that means so I thought I'd just give it a try. 
Here's what I got (again, this is just FYI):

---------------------------------------------------------------

C:\Eiffel\gobo35\doc\misc>gexslt --file=C:\RngToRnc\RngToRncText.xsl -
-file=.\gobo.rng --output=gobo.rnc
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.
At line 81 in file:/C%3A/RngToRnc/RngToRncProcessorConfig.xsl:
Fatal error: http://www.w3.org/2005/xqt-errors#XPST0017: XPath syntax 
error on line 81 in ½exslt:node-set ($schema)+:
    Unknown function (or wrong number of arguments to function): 
exslt:node-set
At line 89 in file:/C%3A/RngToRnc/RngToRncProcessorConfig.xsl:
Fatal error: http://www.w3.org/2005/xqt-errors#XPST0017: XPath syntax 
error on line 89 in ½exslt:node-set ($schema)+:
    Unknown function (or wrong number of arguments to function): 
exslt:node-set
At line 96 in file:/C%3A/RngToRnc/RngToRncProcessorConfig.xsl:
Fatal error: http://www.w3.org/2005/xqt-errors#XPST0017: XPath syntax 
error on line 96 in ½ms:node-set ($schema)+:
    Unknown function (or wrong number of arguments to function): 
ms:node-set
Could not compile stylesheet: There were error compiling the 
stylesheet

-------------------------------------------------------------

So I said, gexslt must not support that function. So the readme 
provides an alternate conversion method:

  "The conversion is done in two steps. The basic conversion
   to the compact syntax is handled by the RngToRncXml.xsl
   stylesheet. The result is an intermediate representation of a
   compact schema expressed in XML. To get the final result, a
   second stylesheet must be applied to the intermediate result.
   Included in the package are output modules for plain text and
   HTML."

It doesn't really say what the second stylesheet is, but there are 
only a few of them in the directory. So here's my second try:

---------------------------------------------------------------

C:\Eiffel\gobo35\doc\misc>gexslt --file=C:\RngToRnc\RngToRncXml.xsl --
file=.\gobo.rng --output=gobo.rncxml
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.

---------------------------------------------------------------

That seemed to work. Now I have my intermediate file named 
gobo.rncxml. The readme isn't too clear on what to do next. It just 
says it must be processed a second time, and that I can output text 
or html. Here are my stylesheet options:

RngToRncClassic.xsl
RngToRncHtml.xsl
RngToRncProcessorConfig.xsl
RngToRncText.xsl
RngToRncXml.xsl

I'm going to pick RngToRncText.xsl since, although it failed last 
time, seems like the most logical choice for the intermediate file:

---------------------------------------------------------------

C:\Eiffel\gobo35\doc\misc>gexslt --file=C:\RngToRnc\RngToRncText.xsl -
-file=.\gobo.rncxml --output=gobo.rnc
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.

At line 81 in file:/C%3A/RngToRnc/RngToRncProcessorConfig.xsl:
Fatal error: http://www.w3.org/2005/xqt-errors#XPST0017: XPath syntax 
error on line 81 in ½exslt:node-set ($schema)+:
    Unknown function (or wrong number of arguments to function): 
exslt:node-set
At line 89 in file:/C%3A/RngToRnc/RngToRncProcessorConfig.xsl:
Fatal error: http://www.w3.org/2005/xqt-errors#XPST0017: XPath syntax 
error on line 89 in ½exslt:node-set ($schema)+:
    Unknown function (or wrong number of arguments to function): 
exslt:node-set
At line 96 in file:/C%3A/RngToRnc/RngToRncProcessorConfig.xsl:
Fatal error: http://www.w3.org/2005/xqt-errors#XPST0017: XPath syntax 
error on line 96 in ½ms:node-set ($schema)+:
    Unknown function (or wrong number of arguments to function): 
ms:node-set
Could not compile stylesheet: There were error compiling the 
stylesheet

------------------------------------------------------------

Hrm. Maybe that wasn't the right thing to do. The readme also says:

  "RngToRncClassic.xsl is the non-modularized stylesheet that
   preceded this version. It is provided as a fallback if you
   have trouble with the more processor dependent nature of the
   new solution. However, it can only produce plain text output."

Hey, this sounds perfect:

------------------------------------------------------------

C:\Eiffel\gobo35\doc\misc>gexslt --
file=C:\RngToRnc\RngToRncClassic.xsl --file=.\gobo.rng --
output=gobo.rnc
Warning: XSLT 1.0 stylesheet is being run on an XSLT 2.0 processor.

------------------------------------------------------------

At this point I got a Windows dialog "gexslt.exe has encountered a 
problem and needs to close." Maybe something is wrong in the 
stylesheet, but I think this is a bug in gexslt that needs to be 
fixed (it shouldn't crash). Do you want me to open a bug report?

So, I'm giving up on that. The nxml readme also mentions a tool 
called Trang to convert RNG to RNC. I'll try that next. As I said, 
this information is FYI in case there are areas you (Berend, Colin or 
others) are willing to improve. I'm using gexslt version 3.5.

Thanks!
Brian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.