Hussein,
Thank you kindly. My problem, as you correctly guessed, was that I
wasn't replacing the text node, but only attempting to add another
node, after which I was going to delete the text node. My method
didn't work because it would've involved violating the content model.
Regards,

On 1/6/06, Hussein Shafie <hussein at xmlmind.com> wrote:
> Chris Chiasson wrote:
> > Maybe I'm just dumb, but I can't add a firstname or surname element as
> > the child of an otherwise blank personname element using docbook
> > version 5 (rng) under XXE. I noticed that the sample.xml file has
> > these elements and that I can copy and paste the entire personname
> > element to my article from the sample article.
>
> By default[*] a personname is created using the simplest possible
> content which is text.
>
> Clicking inside a newly created personname element and hitting Shift-F1
> (see attached screen shot) shows that personname can contain a ``loose
> text mix'' *or* something more structured: firstname, surname, etc.
>
> Therefore, explicitly select the text node, for example by clicking on
> "#text" in the node path bar, and then use command Replace (Ctrl-R) to
> replace this text node by a firstname element.
>
> Then click inside the firstname element and use command Insert After
> (Ctrl-J) to append a lastname element.
>
> Note that all this complexity does not come from RELAX NG itself, but
> rather from the content model chosen for the personname element in
> DocBook5.
>
> ---
> [*] You can define an *element* *template* for personname if you wish to
> change this. See
> http://www.xmlmind.com/xmleditor/_distrib/doc/configure/elementTemplate.html
>
> Doing so without having to tweak configuration files is expected to
> become trivial in XXE V3.2 or V3.3.
>
>
>
>


--
http://chrischiasson.com/contact/chris_chiasson

Reply via email to