Rollin' on to another question :)

How do I refine this so that it works for an element called 'para', but 
leaves ENTER inserting a '\n' in paras that have xml:space 'preserve'?

To state the desired behavior:

    ENTER bound to "addSameAfter" for certain nodes that do NOT have 
xml:space set to 'preserve'
    ENTER inserts a simple '\n' in all other cases

I can't figure out how to select an element by attribute in a command.

Thanks again for any help.  Cheers,
j

Jed Parsons wrote:

>
> Fantastic.  Thanks so much for this example.  I'm rollin' now!
>
> Cheers,
> j
>
> Hussein Shafie wrote:
>
>>Jed Parsons wrote:
>>  
>>
>>>I'm not using docbook in this case, but an in-house xml dialect.  Are
>>>there generic versions of "docb.addSame" etc. that I can use as the
>>>command in the bindings?
>>>    
>>>
>>
>>If your in-house XML dialect is not too complex, writing a few simple
>>macro-commands such as:
>>
>>---
>>  <command name="addSameAfter">
>>    <macro>
>>      <sequence>
>>        <command name="selectNode"
>>                 parameter="ancestorOrSelf[implicitElement] p pre li" />
>>        <command name="insertNode" parameter="sameElementAfter" />
>>      </sequence>
>>    </macro>
>>  </command>
>>---
>>
>>should work fine.
>>
>>In the above macro, replace "p pre li" by your own block element names.
>>Note that the order of element names may be significant. In the case of
>>the above example -- XHTML -- an li may contain a p. Therefore the above
>>macro will try to insert a p before trying to insert a li.
>>
>>See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/ch02.html
>>
>>See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/selectNode.html
>>
>>See http://www.xmlmind.com/xmleditor/_distrib/doc/commands/insertNode.html
>>
>>
>>  
>>
>
>-- 
>Jed Parsons                        / Industrial Light + Magic : 415.746.2974
>  
>grep(do{for(ord){$o+=$_&7;grep(vec($j,+$o++,1)=1,5..($_>>3||print"$j\n"))}},
>(split(//,"))*))2+29*2:.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:\7Glug!")));
>
>  
>
>------------------------------------------------------------------------
>
> 
>--
>XMLmind XML Editor Support List
>xmleditor-support at xmlmind.com
>http://www.xmlmind.com/mailman/listinfo/xmleditor-support
>

-- 
Jed Parsons                        / Industrial Light + Magic : 415.746.2974
  
grep(do{for(ord){$o+=$_&7;grep(vec($j,+$o++,1)=1,5..($_>>3||print"$j\n"))}},
(split(//,"))*))2+29*2:.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:\7Glug!")));


-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20060216/2e47dd9c/attachment.htm
 

Reply via email to