XMetal and Default Element Content

Marlin (archive)

Usenet Archive
Joined
Jul 5, 2004
Messages
2
Reaction score
0
I am inquiring for a customer of mine who is using XMetal 3.0 as an XML editor. I am trying to add default content to an element so that this content is inserted when the element is inserted.

In more detail: When using XMetal to view an XML file in 'tags on' view, you are able to view the attributes and the elements that are allowed within each tag depending on where you are in the document. From here you can select the tag you are wanting to add and it automatically inserts the start and end tag into the document.

In regards to Cross References (XPointers), our DTD using the tag <xref>, with the fixed attribute "xmlns:xlink=http://www.w3.org/1999/xlink" When an xref tag is inserted into an XML document, the markup <xref> </xref> is added.

At present, when you switch to plain text view only the <xref> </xref> markup is inserted. Is possible to include the xlink text (xmlns:xlink=http://www.w3.org/1999/xlink) to this element so that when it is inserted, this xlink text is also inserted into the document saving typing it each time? That is: in plain text view, the document will display "<xref xmlns:xlink="http://www.w3.org/1999/xlink" </xref>.

For your information , the DTD defines this element as follows:
<!ELEMENT xref (#PCDATA)>
<!ATTLIST xref
xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink" xlink:type (simple) #FIXED "simple" xlink:href CDATA #REQUIRED >

Also, I attempted to do this via the Tools/Customizations/On Insert/Content menu but it does not appear to add the specified text to the element when inserted.

Can anyone help?
 
N

nobody

Marlin wrote:

(late answer as I've been away for a while)
I am trying to add default content to an element so that this content is inserted when the element is inserted.

this can be done with a template in the CTM file:

<Template>
<Name>elem</Name>
<MiniTemplate><![CDATA[<elem
attr="val"/>]]></MiniTemplate>
</Template>

HTH, andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top