Re: [emacs-nxml-mode] editing xhtml fragments
On 17/08/11 19:19, Stephen Langer wrote:
> What would be useful would be for each file to contain a special
> comment that says what the enclosing elements are. I think I used to
> use psgml mode to do this. I don't remember exactly what prompted me
> to switch to nxml.
I looked at it and went back to psgml. It's simply doesn't have the
interface (commands) that you need for writing and editing, and as 99%
of my work is with people who use DTDs, it's not much use for that
either. I'm sure it's terribly clever, but without the command-set and
the ability to use DTDs, it's crippled.
On 17/08/11 07:31, Mihamina Rakotomandimby wrote:
> How to:
> - Get nXML accept my malformed XML docs (no DOCTYPE, nothing but
> xHTML fragments)
I don't think you can do that without surgery.
To use a fragment, specify the enclosing element type in a DOCTYPE
Declaration, and use a DTD-aware environment.
> - Get nXML use my C-c C-t to create tag.
Pass. Psgml provide C-c C-e for this ("elements", not "tags"; if you
*really* mean create tag, psgml provides C-c < to create a start-tag and
C-c / to create the matching end-tag).
- On 17 August 2011 19:19, Stephen Langer <stephen.langer@...> wrote:
>In which case provide the rnc schema for nxml-mode to use.
> On Aug 17, 2011, at 11:48 AM, Dave Pawson wrote:
>>> Thanks. I'd forgotten that I'd already done that. But I never figured out how to tell nxml that a file whose first xml tag was <chapter> or <para> is valid, because it's included in another file which contains the required surrounding tags.
>> Wrong tool
>> Validate on the command line,
> But isn't the whole point that nxml helps you write valid xml, by showing you your mistakes and suggesting and autocompleting the valid tags at any point? What's the point of using nxml if you have to validate outside of emacs?
nxml-mode doesn't hack xinclude or external entities.
>I didn't suggest it was. Modify the start element in one schema covering
>> or edit the rnc file to tell nxml-mode
>> that the entity can start on chapter?
> But I have lots of included files, and they aren't all chapters, and it's not practical to have separate rnc files for them all.
the entire included document.
> What would be useful would be for each file to contain a special comment that says what the enclosing elements are. I think I used to use psgml mode to do this. I don't remember exactly what prompted me to switch to nxml.
Revert to sgml-mode?
XSLT XSL-FO FAQ.
>>>>> Mihamina Rakotomandimby <mihamina@...>:You could try to "sudo apt-get install psgml"...?
> In my old Emacs, I used "M-x xml-mode" which drove me to the SGML mode.
> In Emacs 23 (Ubuntu Oneiric flavor), nXML mode takes it.
It may not bind to your XML documents file extensions in
auto-mode-alist, but that's easily fixed.
psgml is still present in oneiric: http://packages.ubuntu.com/oneiric/psgml
> The problem with nXML (and me) is:nXML has chosen a different approach.
> - the lone shortcut I use, C-c C-t (create tag) is not in use.
See my examples here for using nXML to insert tags and attributes: