Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

emacs-nxml-mode · New XML Mode for Emacs

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 239
  • Category: XML
  • Founded: Sep 5, 2003
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 1355 - 1399 of 2146   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#1355 From: "Ammi H'med" <mehdi_terraneen@...>
Date: Thu Jun 1, 2006 2:39 pm
Subject: alphaflow alf xml files how to ?
mehdi_terraneen
Send Email Send Email
 
Hi all,
I am not (yet) xml expert, I installed nxml-mode and I would like my
alphaflow alf description files to be recongnized by emacs.
I didn't find a quick and easy tuto about doing that.
"AlphaFlow is a '''simple''', flexible and easy-to-customize workflow
engine
for Plone."
Any hint,
-m

#1356 From: Mehdi <mehdi_terraneen@...>
Date: Thu Jun 1, 2006 2:43 pm
Subject: subscribe
mehdi_terraneen
Send Email Send Email
 
hi


Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.

#1357 From: Lennart Borgman <lennart.borgman.073@...>
Date: Thu Jun 1, 2006 10:44 pm
Subject: Function for change-major-mode-hook
nlborgman
Send Email Send Email
 
Fontification and overlays added by nxml-mode are currently not removed
if you switch to another mode. Try for example switching to
fundamental-mode. To cure this problem something like the function below
should be added to nxml-mode.el:

(defun nxml-change-mode()
   "Remove overlays used by nxml-mode.
This should be run in `change-major-mode-hook'."
   (save-excursion
     (widen)
     (let ((overlays (overlays-in (point-min) (point-max))))
       (mapc (lambda(ovl)
               (let ((cat (overlay-get ovl 'category)))
                 (when (memq cat '(nxml-dependent rng-dependent rng-error))
                   (delete-overlay ovl)
                   )))
             overlays))
     (remove-text-properties (point-min) (point-max) '(face nil))))

This should then be added in nxml-mode:

   (add-hook 'change-major-mode-hook 'nxml-change-mode nil t)

#1358 From: "aamehl" <aamehl@...>
Date: Wed Jun 7, 2006 12:59 pm
Subject: folding folly
aamehl
Send Email Send Email
 
Hi all,

I am restructuring an exisiting manual and want to see only my sect1
elements hiding the lower elements.

I would like this to work also for sect2 and so on.

But invoking any of the nxml outline features just gives me my first
sect1.

does this have something to do with indenting?


Or maybe there is something I just don't understand about this.

BTW is this related in someway to folding?

Thanks
Aaron

#1359 From: Florent Georges <darkman_spam@...>
Date: Wed Jun 7, 2006 1:47 pm
Subject: RE : folding folly
darkman_spam
Send Email Send Email
 
aamehl wrote:

   Hi

> But invoking any of the nxml outline features just gives me
> my first sect1.

   I'm not familiar with the folding feature of nXML, but I guess givin
a sample minimal XML document as well as steps to reproduce the problem
("with the point at XXX, typing XXX and calling XXX results in XXX")
may help.

   Regards,

--drkm




























__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible
contre les messages non sollicités
http://mail.yahoo.fr Yahoo! Mail

#1360 From: "urvasi1993" <urvasi1993@...>
Date: Wed Jul 5, 2006 9:01 am
Subject: visit, join , forward http://www.studyjava.org/forums/
urvasi1993
Send Email Send Email
 
#1362 From: "iamverysimpleguy" <iwillshareurlife@...>
Date: Wed Jul 19, 2006 4:09 pm
Subject: Re: visit, join , forward http://www.studyjava.org/forums/
iamverysimpl...
Send Email Send Email
 
hi Urvasi, thanks for your invitation.

i am not from software side.

i am Unix Administrator.

#1363 From: Lennart Borgman <lennart.borgman.073@...>
Date: Thu Jul 20, 2006 12:15 am
Subject: Using rng*.el for css mode
nlborgman
Send Email Send Email
 
Would it be possible to use the rng*.el files that comes with nxml-mode
to write a new mode for CSS files? Any tips about what is needed to do that?

#1364 From: Florent Georges <darkman_spam@...>
Date: Thu Jul 20, 2006 4:35 pm
Subject: Re: Using rng*.el for css mode
darkman_spam
Send Email Send Email
 
Lennart Borgman wrote:

   Hi

> Would it be possible to use the rng*.el files that comes with
> nxml-mode to write a new mode for CSS files? Any tips about
> what is needed to do that?

   It depends what you want to do.  I guess this is about completion
against a schema?  So you can use 'rng-c-parse-file' to parse an RNC
schema.  The structure of its result is documented at the top of
rng-pttrn.el.

   Regards,

--drkm



























___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos
expériences.
http://fr.answers.yahoo.com

#1365 From: "Chris Chiasson" <chris@...>
Date: Thu Jul 20, 2006 4:54 pm
Subject: Re: Using rng*.el for css mode
cpcender
Send Email Send Email
 
isn't there already an emacs major mode for css?

On 7/20/06, Florent Georges <darkman_spam@...> wrote:
> Lennart Borgman wrote:
>
>   Hi
>
> > Would it be possible to use the rng*.el files that comes with
> > nxml-mode to write a new mode for CSS files? Any tips about
> > what is needed to do that?
>
>   It depends what you want to do.  I guess this is about completion
> against a schema?  So you can use 'rng-c-parse-file' to parse an RNC
> schema.  The structure of its result is documented at the top of
> rng-pttrn.el.
>
>   Regards,
>
> --drkm
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> ___________________________________________________________________________
> Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet
!
> Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos
expériences.
> http://fr.answers.yahoo.com
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


--
http://chris.chiasson.name/

#1366 From: Edward O'Connor <hober0@...>
Date: Thu Jul 20, 2006 5:43 pm
Subject: Re: Using rng*.el for css mode
hmallow42
Send Email Send Email
 
[This is a re-send; apologies if it shows up on the list twice.]

Chris Chiasson wrote:

> isn't there already an emacs major mode for css?

Several even. I've tried several and have been most happy with this one:

http://www.garshol.priv.no/download/software/css-mode/css-mode.el


Ted

--
Edward O'Connor
hober0@...

Ense petit placidam sub libertate quietem.

#1367 From: Florent Georges <darkman_spam@...>
Date: Thu Jul 20, 2006 6:28 pm
Subject: Re: Using rng*.el for css mode
darkman_spam
Send Email Send Email
 
Edward O'Connor wrote:

> > isn't there already an emacs major mode for css?

> Several even. I've tried several and have been most happy with this
> one:

> http://www.garshol.priv.no/download/software/css-mode/css-mode.el

   I didn't study it in details, but it seems to not support completion
against a schema.  Since Lennart (mmh, he was Lennart, right?) spook
about rng-*.el libraries, I guess he plans to provide such a completion
system (it is just a guess).

   As I never wrote a complex CSS file, I don't know if it could be
usefull (but I guess so).

   Regards,

--drkm




























___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos
expériences.
http://fr.answers.yahoo.com

#1368 From: Lennart Borgman <lennart.borgman.073@...>
Date: Thu Jul 20, 2006 7:44 pm
Subject: Re: Using rng*.el for css mode
nlborgman
Send Email Send Email
 
Florent Georges wrote:
> Lennart Borgman wrote:
>
>   Hi
>
>
>> Would it be possible to use the rng*.el files that comes with
>> nxml-mode to write a new mode for CSS files? Any tips about
>> what is needed to do that?
>>
>
>   It depends what you want to do.  I guess this is about completion
> against a schema?  So you can use 'rng-c-parse-file' to parse an RNC
> schema.  The structure of its result is documented at the top of
> rng-pttrn.el.
>
>   Regards,
>
> --drkm
>
Thanks drkm, that was what I had in mind. Context sensitive completion.
I will have a look and see how much trouble it is.

#1369 From: Florent Georges <darkman_spam@...>
Date: Thu Jul 20, 2006 7:53 pm
Subject: Re: Using rng*.el for css mode
darkman_spam
Send Email Send Email
 
Lennart Borgman wrote:

   Hi

> Thanks drkm, that was what I had in mind. Context sensitive
> completion.
> I will have a look and see how much trouble it is.

   You can also take a look at 'nxml-complete' to see an example of use.
  Note I never look at this code, so I don't know if it is complex or
not (it has to deal with the context maintained by nXML, but in this
context I guess that's not too complex).

   Regards,

--drkm


























___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos
expériences.
http://fr.answers.yahoo.com

#1370 From: Lennart Borgman <lennart.borgman.073@...>
Date: Thu Jul 20, 2006 8:04 pm
Subject: Re: Re: Using rng*.el for css mode
nlborgman
Send Email Send Email
 
Edward O'Connor wrote:
> [This is a re-send; apologies if it shows up on the list twice.]
>
> Chris Chiasson wrote:
>
>
>> isn't there already an emacs major mode for css?
>>
>
> Several even. I've tried several and have been most happy with this one:
>
> http://www.garshol.priv.no/download/software/css-mode/css-mode.el
>
Thanks Ted. I know about these modes (from
http://www.emacswiki.org/cgi-bin/wiki/CascadingStyleSheetMode). However
does any of those have context sensitive completion?

#1371 From: Lennart Borgman <lennart.borgman.073@...>
Date: Thu Jul 20, 2006 8:11 pm
Subject: Re: Using rng*.el for css mode
nlborgman
Send Email Send Email
 
Florent Georges wrote:
> Lennart Borgman wrote:
>
>   Hi
>
>
>> Thanks drkm, that was what I had in mind. Context sensitive
>> completion.
>> I will have a look and see how much trouble it is.
>>
>
>   You can also take a look at 'nxml-complete' to see an example of use.
>  Note I never look at this code, so I don't know if it is complex or
> not (it has to deal with the context maintained by nXML, but in this
> context I guess that's not too complex).
>
I have played a little bit with nxtml-complete in nxhtml-mode and I did
find it rather complex. However in the case of css it looks much easier
to restart the parsing.

A problem is of course that much of this is over my head. But since
someone (JC) has done the difficult parts maybe it is possible to borrow
some small things ... ;-)

#1372 From: "fabrulous" <fabrulous@...>
Date: Wed Jul 26, 2006 5:31 am
Subject: unclutter minor-mode for editing docbook
fabrulous
Send Email Send Email
 
Hi everybody,

first post on this group...   Years ago I was addicted to a LaTeX
minor-mode for emacs called "talcum" (was it already called like that?
I don't remember) that would "unclutter" what is displayed on screen.


The difference a "normal" view of a LaTeX file under emacs and the
same file viewed "uncluttered" can be seen here:

http://talcum.sarovar.org/

This was so efficient/elegant/insert-nice-word-here (and still is)
that I couldn't edit LaTeX file without using this minor-mode.

Some other "editors" do the same.  For example IntelliJ IDEA (Java
editor written in Java), to some extent, does "collapse" uninteresting
stuff.  And I've hacked a little bit simple IntelliJ IDEA plugins to
do my own "uncluttering".

Is there such a thing for nxml-mode when editing docbook under emacs?

My Lisp skills aren't good (I'm starting to learn it, just printed
various docs/tutorials), so I can't do it myself.

I'm writing some technical documentation right now and I need to use a
lot of <emphasis> tags all the time.  This makes the document really
hard to read when I'm under emacs (that is: most of my time in front
of the computer ;)

If such an "unclutter" mode doesn't exist, how hard would it be to
have a minor-mode (?) that does the trick simply for the <emphasis> tag?

That is, instead of seeing this:

     <para>
       Let's put <emphasis>some text</emphasis> here.
     </para>

I'd like to see:

     <p>
       Let's put <e>some text</e> here.
     </p>


Of course it has to be just an "visual" unclutter action: the XML file
saved should still have the correct <para> and <emphasis> tags in it
(and nxml-mode's real-time validation should still work).

If my explanations aren't clear (I'm not a native english speaker),
you can take a quick look at the link I provided.

This is really good stuff.

Any hints on how to find / adapt such a minor-mode for emacs ?

thanks in advance for any help this,

   fab (using and loving nxml-mode... In fact I switched from xemacs to
emacs just for this mode :)

#1375 From: "aamehl" <aamehl@...>
Date: Wed Aug 9, 2006 6:04 am
Subject: aliasing tags?
aamehl
Send Email Send Email
 
Hi all,

I was wondering how possible this would be.

I want to have emacs/nxml alias the tags so that a user doesn't see
the actual docbook/xhtml etc elements but a marker. (I know who needs
such a thing, but I have so "I am scared of tags people)

Additionally I would like to map the Return key to (once enable that
way) put down the default tag (as defined) for that element.

For example:

<section1><title></title>{Return} would a <para></para> with the
cursor between the start and end tag.

Another return would put down another <para></para> of course
additional tags would need to be entered explicitly.

The same for lists with Return laying down the list item plus para tag
unless explicitly stopped.

Is this at all possible with emacs/nxml?

Thanks,
Aaron

#1376 From: "Chris Chiasson" <chris@...>
Date: Sun Aug 13, 2006 7:25 am
Subject: share your xinclude enabled DocBook 5 rnc grammar?
cpcender
Send Email Send Email
 
I am in the process of switching to db5. Given (the generality of)
RELAX NG and the requirements of nxml mode, my guess is that (at
least) someone has written a db5 schema extension that allows
xi:include to occurr anywhere in db5 document. If you have written
such an extension of db5 and you are inclined to share it, I beg you
to do so.
Thank you,

--
http://chris.chiasson.name/

#1377 From: Norman Walsh <ndw@...>
Date: Mon Aug 14, 2006 1:30 pm
Subject: Re: share your xinclude enabled DocBook 5 rnc grammar?
normwalsh
Send Email Send Email
 
/ "Chris Chiasson" <chris@...> was heard to say:
|     <div id="ygrp-text">
|             <p>I am in the process of switching to db5. Given (the generality
of)<br>
| RELAX NG and the requirements of nxml mode, my guess is that (at<br>
| least) someone has written a db5 schema extension that allows<br>
| xi:include to occurr anywhere in db5 document. If you have written<br>
| such an extension of db5 and you are inclined to share it, I beg you<br>
| to do so.<br>

That's part of the standard 5.0 distribution. For example,

   http://docbook.org/xml/5.0b7/rng/docbookxi.rnc

                                         Be seeing you,
                                           norm

--
Norman Walsh <ndw@...> | Everything should be made as simple as
http://nwalsh.com/            | possible, but no simpler.

#1379 From: "Chris Chiasson" <chris@...>
Date: Mon Aug 14, 2006 6:58 pm
Subject: Re: share your xinclude enabled DocBook 5 rnc grammar?
cpcender
Send Email Send Email
 
Funny and humiliating :-]

On 8/14/06, Norman Walsh <ndw@...> wrote:
> / "Chris Chiasson" <chris@...> was heard to say:
> |     <div id="ygrp-text">
> |             <p>I am in the process of switching to db5. Given (the
generality of)<br>
> | RELAX NG and the requirements of nxml mode, my guess is that (at<br>
> | least) someone has written a db5 schema extension that allows<br>
> | xi:include to occurr anywhere in db5 document. If you have written<br>
> | such an extension of db5 and you are inclined to share it, I beg you<br>
> | to do so.<br>
>
> That's part of the standard 5.0 distribution. For example,
>
>   http://docbook.org/xml/5.0b7/rng/docbookxi.rnc
>
>                                         Be seeing you,
>                                           norm
>
> --
> Norman Walsh <ndw@...> | Everything should be made as simple as
> http://nwalsh.com/            | possible, but no simpler.
>
>
>


--
http://chris.chiasson.name/

#1391 From: Gore Casal <gorecasal@...>
Date: Fri Oct 27, 2006 9:15 am
Subject: The Great Stock Market Secret
gorecasal
Send Email Send Email
 

The Great Stock Market Secret

When the stock market is going up and all your stocks and mutual funds are making money you feel like a genius. It is too bad that some folks don’t remember what happened in 2000. Of course, right now we are in one of those genius phases. Your broker and financial planner are encouraging you to buy, buy, buy. And I can’t fault that at this time. You remember back in 2000 how many times they told you to buy, buy, buy while the market was going down, down, down. Are we in another of those periods now that are leading up to a humongous crash? Hey, I don’t predict, but I do listen to the voice of the market.
 
 


Stay in the know. Pulse on the new Yahoo.com. Check it out.

#1392 From: Mondy Santilo <mondysantilo@...>
Date: Thu Nov 2, 2006 7:56 am
Subject: How To Succeed In Online Financial Trading Using Freebies
mondysantilo
Send Email Send Email
 

How To Succeed In Online Financial Trading Using Freebies

Did you know that many of the tools and resources that we consider essential for online trading success are actually available for free - if you know where to look?

Online trading is taking the financial markets by storm as private investors are now able to quickly, easily and cheaply trade Forex, Commodities, Stocks and many other instruments. But what’s brought about this enormous increase in online trading?
 
 


We have the perfect Group for you. Check out the handy changes to Yahoo! Groups.

#1393 From: Steinar Bang <sb@...>
Date: Wed Nov 29, 2006 6:46 pm
Subject: Starting with nxml
sb@...
Send Email Send Email
 
Platform: Intel Pentium M,
	   Ubuntu Dapper,
	   emacs21 21.4a-3ubuntu2,
	   nxml-mode 20041004-5
	   trang 20030619-4

I am a _long_ time psgml user that eventually will try the leap into
nxml.  The reason is that I need context sensitive editing for an XML
format for which I have an XSD schema (the Maven2 POM format).

So I'm fumbling about trying to get started.

I started by trying to create a schema locator, from the description
here:
  http://www.dpawson.co.uk/relaxng/nxml/schemaloc.html#d339e168

`C-h v rng-schema-locating-files RET' gives me:
  rng-schema-locating-files's value is
  ("schemas.xml" "/usr/share/emacs/site-lisp/nxml-mode/schema/schemas.xml")

So I did `C-x C-f schema.xml RET' in the same directory as the pom.xml
file that is to be edited.  nxml gave the minibuffer message "Using
vacuous schema".  I pasted in the example in the above URL, ie.
  <?xml version="1.0"?>
  <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
    <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/>
    <documentElement localName="book" uri="docbook.rnc"/>
  </locatingRules>

Then I deleted the <namespace> and <documentElement> elements, and
tried creating a new element.  I tried `C-c C-e' to see if that would
give me the list of available elements (that's the psgml binding for
the same... who reads manuals...? :-) ).

That didn't work, so I did `C-h b' to see if there was an
nxml-insert-element command or something similar.  The only commands
with "insert" in them, are:
C-c C-u         nxml-insert-named-char
C-c C-x         nxml-insert-xml-declaration

Some more browsing on Dave's Q&A seemed to indicate that `C-RET' was
the correct command (nxml-complete).  But this command just reports
"Cannot complete in this context".

So is the problem that it can't find the schema?  Or is this the wrong
command?  Or am I trying an insert in the wrong place?  Or does the
insert command have a problem with empty elements?

I don't think it is a missing schema, because the show schema location
command, reports
  "Using schema /usr/share/emacs/site-lisp/nxml-mode/schema/locate.rnc"

Perhaps it's the wrong command?  It seems to be a command to complete
_something_, but how do I know what to complete at this stage....?

Ah... if I type a `<' and _then_ `C-RET' I get a list of whatever can
be inserted at point, which is (probably) the allowed tags.  And to
insert attributes I type a space and then `C-RET' again.  To complete
an attribute value I type " followed by a space.  `C-RET' again gives
me the possibility to insert a new attribute.  And typing / and >
closes the element (there seemed to be no magic here).

This works after a fashion.  But I prefer the psgml way of `C-e',
select the element, and then respond to prompts for required
attributes, followed by `C-c +' commands to insert other attributes.

Perhaps I'll get used to this way in time?  Or perhaps there is a more
psgml-like mode of operation that I haven't discovered yet?  (12 years
takes a lot of unlearning...)

Ok, so on to the schema.  I've now created a schema.xml file that
resides in the same directory as the pom.xml file, that looks like
this:
  <?xml version="1.0"?>
  <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
    <namespace ns="http://maven.apache.org/POM/4.0.0" uri="maven.rnc" />
  </locatingRules>

This based on a pom.xml header looking like this:
  <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

Next is to give trang a look.  Hm... doesn't look like it supports XSD
schema as an input schema...?
  http://www.thaiopensource.com/relaxng/trang.html

Or has things happened since James dropped it?

Doesn't look that way, when looking at the man page of the Ubuntu
(debian?) deb package.  It has XSD as an output format, but not as an
input format.

Hm... unless I can convert the maven2 XSD schema to an RNG schema, I
might as well roll back to good old psgml.  Is there something else I
can use?  Or is there a maven2 POM XML RNG schema around?

Ok.  From the bottom of http://www.thaiopensource.com/nxml-mode/
I found rngconv.  The procedure to use, was:

  - download rngconv.zip from
     https://msv.dev.java.net/servlets/ProjectDocumentList?folderID=101

  - unzip rngconv.zip.  It will create the directory rngconv-20060319/

  - go to the rngconv-20060319/ directory, and type the following
    commands:
	 wget http://maven.apache.org/maven-v4_0_0.xsd
	 java -jar rngconv.jar maven-v4_0_0.xsd >maven.rng
	 trang maven.rng maven.rnc

  - then move maven.rnc to whereever the schemas.xml file resides
    (currently the same directory as the top level pom.xml file of the
    project I'm working on)

So now I appearently have a working schema.

I get an error message from the xsi:schemaLocation attribute.
Does nxml support namespaces?  Does anyone know what magic is needed
to do so?

Does anyone have a best practice for setting up my own RNG schema
location?  I won't do it tonight.  Now it's time for actually _using_
that schema on the pom.xml file(s)...:-)

#1394 From: "Dave Pawson" <dave.pawson@...>
Date: Wed Nov 29, 2006 8:21 pm
Subject: Re: Starting with nxml
dpawson2000
Send Email Send Email
 
On 29/11/06, Steinar Bang <sb@...> wrote:
> Platform: Intel Pentium M,
>           Ubuntu Dapper,
>           emacs21 21.4a-3ubuntu2,
>           nxml-mode 20041004-5
>           trang 20030619-4
>
> I am a _long_ time psgml user that eventually will try the leap into
> nxml.  The reason is that I need context sensitive editing for an XML
> format for which I have an XSD schema

James came from Relax to relax NG.
nxml-mode works (once you read the manual :-) with the .rnc
format of a relax ng schema.
XSD is the [insert bad language] cousin of relax-NG

If you only have the xsd,
go dig out rngconv from the sun downloads.

It tries to convert XSD to rng format.
Trang, from JC, converts from rng to XSD if needed.

It may work on your schema, it may not.
Either way, take a look at Eric's book on relax ng, available on line
but well worth buying.
Before you have had your first headache with xsd, you'll be happy
with relax NG.

Then you can convert the xsd into relax ng!

I've associated F9 with 'associate schema' to make it easier.


HTH DaveP



--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

#1395 From: "Michael(tm) Smith" <smith@...>
Date: Thu Nov 30, 2006 8:27 am
Subject: Re: Starting with nxml
xmldoc
Send Email Send Email
 
Steinar Bang <sb@...>, 2006-11-29 19:46 +0100:

> So now I appearently have a working schema.
>
> I get an error message from the xsi:schemaLocation attribute.

Do you get an error because the particular file you're editing
contains an an xsi:schemaLocation instance, or do you just get an
error when nxml is parsing the schema (even when editing a file
that doesn't contain an xsi:schemaLocation)?

> Does nxml support namespaces?  Does anyone know what magic is needed
> to do so?

nxml fully supports namespaces. No magic needed.

> Does anyone have a best practice for setting up my own RNG schema
> location?

If you're keeping your schema under version control, then I guess
one good way would be put it into whatever directory tree you keep
anything similar that you've got under version control (custom
DTDs, stylesheet customizations) and just point your
locating-rules file (e.g., schemas.xml) file to that.

   --Mike

#1396 From: Steinar Bang <sb@...>
Date: Thu Nov 30, 2006 8:54 am
Subject: Re: Starting with nxml
sb@...
Send Email Send Email
 
>>>>> "Michael(tm) Smith" <smith@...>:

> Do you get an error because the particular file you're editing
> contains an an xsi:schemaLocation instance, or do you just get an
> error when nxml is parsing the schema (even when editing a file that
> doesn't contain an xsi:schemaLocation)?

I get the error because the file contains an xsi:schemaLocation
instance.

> nxml fully supports namespaces. No magic needed.

Do I need a schema that allows using a schemaLocation attribute in the
"http://www.w3.org/2001/XMLSchema-instance" namespace, in any element
in any namespace?

If so, I have no idea how to go about it.

Or should I hack the RNG schema I've created from an XSD schema using
rngconv, to allow the "xsi:schemaLocation" attribute on the top level
attribute?

Thanx!

#1397 From: Steinar Bang <sb@...>
Date: Thu Nov 30, 2006 8:49 am
Subject: Re: Starting with nxml
sb@...
Send Email Send Email
 
>>>>> "Dave Pawson" <dave.pawson@...>:

> James came from Relax to relax NG.  nxml-mode works (once you read
> the manual :-) with the .rnc format of a relax ng schema.  XSD is
> the [insert bad language] cousin of relax-NG

> If you only have the xsd,
> go dig out rngconv from the sun downloads.

If you read to the bottom.  You will see that's what I did. :-)

I need to think out loud when I'm doing stuff, so the message was
mostly me thinking to myself.  But since I'd written it, and since
this list has been awfully quiet except for spam, I thought I might as
well give it a relevant message. :-)

#1398 From: Florent Georges <darkman_spam@...>
Date: Thu Nov 30, 2006 11:55 am
Subject: Re: Re: Starting with nxml
darkman_spam
Send Email Send Email
 
Steinar Bang wrote:

   Hi

> I get the error because the file contains an xsi:schemaLocation
> instance.

   This attribute has to be explicitelly allowed in RNG grammars.  You
can dig the archives for similar discussions.  But I wonder if an
editing tool like nXML would have to permit the XSI attributes on
elements (for example if the grammar is translated from WXS), and maybe
have some support for them (completion for schema paths, completion for
types, etc.).

   Regards,

--drkm























___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses
http://fr.answers.yahoo.com

#1399 From: Steinar Bang <sb@...>
Date: Thu Nov 30, 2006 7:59 pm
Subject: Re: Starting with nxml
sb@...
Send Email Send Email
 
>>>>> Florent Georges <darkman_spam@...>:

> Steinar Bang wrote:
>   Hi

>> I get the error because the file contains an xsi:schemaLocation
>> instance.

> This attribute has to be explicitelly allowed in RNG grammars.

I tried changing
             <element name="project">
               <interleave>
               ...
to
             <element name="project">
               <attribute>
                 <anyName/>
               </attribute>
               <interleave>
               ...

in the generated RNG schema, and then used trang to translate it into,
   | element project {
       attribute * { text },

But that wasn't enough.

> You can dig the archives for similar discussions.  But I wonder if
> an editing tool like nXML would have to permit the XSI attributes on
> elements (for example if the grammar is translated from WXS), and
> maybe have some support for them (completion for schema paths,
> completion for types, etc.).

Here's an earlier thread on this list:
	 http://comments.gmane.org/gmane.emacs.nxml.general/998

Norm Walsh suggests using a wrapper grammar to add the xsi:
attributes.  That's probably a good idea, but I'll try modifying the
grammar first to see if I can make it work... hm... changing the
attribute declaration to:
   | element project {
       attribute xsi:schemaLocation { text },
gave me the error message
   File mode specification error: (error "Undefined prefix xsi at position 136 in
/media/sda8/bangste/p4/depot/ccr/MAIN/maven.rnc")

Ok I changed (half-guessing, and using nxml to expand what's allowed)
the attribute declaration in the maven.rng file to look like this:
             <element name="project">
               <attribute>
                 <name
ns="http://www.w3.org/2001/XMLSchema-instance">schemaLocation</name>
               </attribute>
               ...

Then ran the schema through trang to get the following in maven.rnc:
  default namespace = "http://maven.apache.org/POM/4.0.0"
  namespace ns1 = "http://www.w3.org/2001/XMLSchema-instance"

  start =
    notAllowed
    | element project {
        attribute ns1:schemaLocation { text },
        (element parent {
        ...

And that's enough to make the Maven POM files validate.  Thanx!

I guess the next step will be to figure out what's meant by an
extension grammar, but for now this quick hack works for me.

Thanx again!

Messages 1355 - 1399 of 2146   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help