Tag matching support for XML files?

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
mwb1100
Posts: 72
Joined: Thu Jun 02, 2005 8:00 am

Tag matching support for XML files?

Post by mwb1100 »

I'm trying out WeBuilder 9.0.0.92 and like what I see. However, right now I'm working more with plain old XML files than HTML and it seems like a couple features aren't enabled for XML, but they are features that I would think should just come for free if they're supported for HTML:
  • matching/unmatched tag highlighting
  • Select Tag/Select Tag Block/Select Tag Contents
edit: removed feature requests per moderator
Last edited by mwb1100 on Thu May 08, 2008 11:55 pm, edited 1 time in total.
User avatar
chrisjlocke
Top Contributor
Posts: 995
Joined: Mon Aug 01, 2005 4:12 pm
Location: Essex, UK
Contact:

Re: Tag matching support for XML files?

Post by chrisjlocke »

Hi,
Can you remove the feature requests from your post, and instead, post them in the feature requests forum. If you leave them here, then they're going to be missed, and we won't be able to find them later. Thanks!
User avatar
Karlis
Site Admin
Posts: 3605
Joined: Mon Jul 15, 2002 5:24 pm
Location: Riga, Latvia, Europe
Contact:

Re: Tag matching support for XML files?

Post by Karlis »

If XML works how I think it works - there are no single tags, each tag has opening and closing tag then the matching tag algorithm should be easy to implement. Tag selection features are already available for XML.
Karlis Blumentals
Blumentals Software
www.blumentals.net
mwb1100
Posts: 72
Joined: Thu Jun 02, 2005 8:00 am

Re: Tag matching support for XML files?

Post by mwb1100 »

Karlis wrote:If XML works how I think it works - there are no single tags, each tag has opening and closing tag then the matching tag algorithm should be easy to implement.
XML is much more strict than plain HTML in that all tags must be properly closed, which means either separate open/close tags or empty tags (like <someTag />).

As with everything there are exceptions like the XML Declaration (<?xml ...?>), entity declarations or attribute lists (<!ENTITY ...> or <!ATTRLIST ...>), CDATA sections, etc. This may make it a little trickier. And now that I think of it, I realize that this is not something 'for free' - you have a well-defined list of tags for HTML documents, but arbitrary tags for XML. I'm not sure why that did not cross my mind... I guess this whole thread should have been in the Feature Request forum instead. If a moderator wants to do that, please do.
Karlis wrote:Tag selection features are already available for XML.
I tried using these little bit more and found that "Select Tag" does work, and "Select Tag Block" works but only if the cursor is on the tag itself (for HTML docs the cursor can be in the tag's content area). "Select Content" does not seem to work - it's only enabled if the cursor is on the tag and does not do anything (same behavior as for HTML docs when cursor is on the tag).

For HTML docs "Select Content" more or less works if the cursor is between the open/close tags, but on closer examination it only works fully if the tag contents contain no nested tags. I don't know if this is 'as designed', but to my mind it would be more useful if it selected the entire contents (kind of a special case of the "Select Tag" operation that simply excludes the open/close tags).
llbbl
Posts: 50
Joined: Thu Mar 27, 2008 9:19 pm

Re: Tag matching support for XML files?

Post by llbbl »

working with CDATA fields is a pain in the arse. I remember having to format some XML using this a while ago.
Jay Q
Posts: 22
Joined: Thu Aug 14, 2008 12:47 am

Re: Tag matching support for XML files?

Post by Jay Q »

Karlis wrote:If XML works how I think it works - there are no single tags, each tag has opening and closing tag then the matching tag algorithm should be easy to implement. Tag selection features are already available for XML.
Unfortunately, empty elements (i.e., single tags) are perfectly legal in XML. Here's a sample block:

Code: Select all

<xsl:variable name="myVar">
    <xsl:call-template name="myTemplate">
        <xsl:with-param name="myName" select="some xpath"/>  <!-- EMPTY ELEMENT -->
    </xsl:call-template>   
</xsl:variable>
I'm really missing this feature; it's absence is what keeps me hanging on to Notepad++. Empty elements are totally commonplace in our XML/XSL, so WeBuilder's XML tag matching is unusable for me.

Karlis, all you'd have to check for empty elements is to see that the opening tag closes with "/>" (see this from the w3c). You think you could implement this (so I could drop Notepad++! ;))?

Jay
Last edited by Jay Q on Tue Aug 25, 2009 7:10 pm, edited 1 time in total.
CaliforniaJerry
Posts: 88
Joined: Sat Aug 01, 2009 4:48 am
Location: Mountain View, CA
Contact:

Re: Tag matching support for XML files?

Post by CaliforniaJerry »

+1
Post Reply