XMetal and Default Element Content

Discussion in 'XML' started by Marlin, Jul 5, 2004.

  1. Marlin

    Marlin Guest

    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?
     
    Marlin, Jul 5, 2004
    #1
    1. Advertising

  2. Marlin

    nobody Guest

    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
     
    nobody, Jul 15, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Falko Guderian
    Replies:
    0
    Views:
    416
    Falko Guderian
    Nov 11, 2003
  2. Mattias Larson
    Replies:
    0
    Views:
    422
    Mattias Larson
    Dec 17, 2003
  3. Nora
    Replies:
    2
    Views:
    459
    Feargal Hogan
    Aug 9, 2004
  4. shavazo

    Users of XMetaL 2.x and 3.x

    shavazo, May 20, 2005, in forum: XML
    Replies:
    1
    Views:
    503
    Peter Flynn
    May 27, 2005
  5. Replies:
    0
    Views:
    440
Loading...

Share This Page