DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion finding otherprops attributes

  • csmith

    finding otherprops attributes

    Participants 11
    Replies 12
    Last Activity 12 years, 11 months ago

    Is there a way to search on otherprops attribute values across all valid elements in a topic? I can do a search that specifies a specific element type, but I want to find them on any element type. Can I set up a search that uses a wildcard for the element type?

    Reply

    Su-Laine Yeo

    Reply to: finding otherprops attributes

    The one thing that comes to mind is using Plain Text View. If you are searching for an otherprops value of “foo”:

    1) Switch to Plain Text View.
    2) Click Edit > Find and Replace.
    3) Type otherprops=”foo” in the Find field of the Find and Replace dialog box.

    The limitation of this method is that if an element has more than one otherprops value, you might miss it. This method won't find elements that have, for example, “otherprops=”bar foo”.

    Cheers,
    Su-Laine

    Reply

    csmith

    Reply to: finding otherprops attributes

    We are using XMetaL in a component CMS that does not support Plain Text View. Any other options?

    Reply

    Su-Laine Yeo

    Reply to: finding otherprops attributes

    You could use any word processor that has a Find feature, such as Notepad or Microsoft Word. If you select your whole document in XMetaL Tags On or Normal view, copy it, and then paste it into a third-party text editor, your document will paste with all attributes visible as plain text.

    Be sure not to modify your document in third-party text editors though, because you won't be able to paste it all back into XMetaL without using Plain Text View.

    Cheers,
    Su-Laine

    Reply

    csmith

    Reply to: finding otherprops attributes

    That is a very awkward workaround that would impact writer productivity. I would prefer having XMetaL enhanced so the search can be done inside the editor.

    It would help to have elements with the the otherprops attribute set highlighted (like product, platform and audience attributes). That would help us find them faster.

    We are a heavy user of filtering through our CMS and need efficient ways of managing filtering attributes. We use otherprops a lot.

    Reply

    Su-Laine Yeo

    Reply to: finding otherprops attributes

    Oh, I see! I'm very glad you've provided this background because styling elements according to their otherprops values is actually much easier than searching. You can do it by configuring the Conditional Text feature as follows:

    1) In Notepad, open the ct_config.xml file from C:Program FilesXMetaL 6.0AuthorConditional Textconfigs
    2) Add the following code immediately before the tag:

    [code] 
     
     
     

    [/code]

    3) Save the ct_config.xml file.
    4) Restart XMetaL.

    After doing the above, you will be able to use the Reuse > Style Conditional Text dialog to apply highlight colors or text colors to elements with the “foo” and “bar” otherprops values. You can also use the Reuse > Apply/Remove Conditions dialog box to apply your otherprops values.

    Cheers,
    Su-Laine

    Reply

    csmith

    Reply to: finding otherprops attributes

    OK, we're making some progress.

    I would like to highlight all elements with *any* otherprops attribute. We use about 20 different otherprops attribute values for filtering, and in many cases we use more than one value on an element. I don't want different highlighting for each case. Once we can visually identify where an otherprops attribute is set, we can look at the Attribute Inspector to see the values. 

    I want this to work just like the highlighting works on the platform, product, and audience attributes–that is, the element is highlighted if *any* value has been set on these attributes.

    I still would like to see this as a capability of the search in XMetaL. But this will help a lot.

    Reply

    Su-Laine Yeo

    Reply to: finding otherprops attributes

    Hi,

    The Style Conditional Text dialog has the option you need. Once you've edited the ct_config.xml file to include values for the otherprops attribute, you can use the Style Conditional Text dialog to apply a default style for elements that have any value for otherprops. It works exactly the same way as styling conditional text for product, platform, and audience.

    I'll also submit a feature request for searching by attribute value.

    Cheers,
    Su-Laine

    Reply

    csmith

    Reply to: finding otherprops attributes

    Great! Thanks for your help. I have already edited the config files and it is working!

    Reply

    Derek Read

    Reply to: finding otherprops attributes

    The Find and Replace dialog allows you to find and replace attribute values in TagsOn and Normal view. You use the Element tab for this.

    For instructions, open the Find and Replace dialog, select the Element tab and click on the Help button. I think this is fairly clearly documented. If something is not clear please ask so we can update the documentation.

    Reply

    csmith

    Reply to: finding otherprops attributes

    I already tried the Find and Replace dialog. I can find all occurrences of a

    element with a specified attribute name/value pair, but I want to find *any* element that has a specified attribute name/value pair. I was looking for a way to wildcard the element name.

    Reply

    Derek Read

    Reply to: finding otherprops attributes

    Sorry about that (I just re-read the original post, this is a long thread now).

    So, no, there is no wildcard support for this particular feature. It would probably be possible to write a script that would allow that and wrap that script in an XFT form if some kind of GUI would be needed (ie: the values you need to find and replace would need to be modifiable by the author of the document and not fixed, which I assume is likely the case).

    The idea of allowing wildcards for the element names (and perhaps attributes) in the existing Find and Replace dialog is an interesting one and we will think about that when we are looking at features to implement in the future.

    Reply

    dcramer

    Reply to: finding otherprops attributes

    The resource manager is another good place to implement that. You could have a little html form that asks for the element name or a wildcard and the attribute name and value, then find all occurrences and display the results in below the form in the resource manager. I do a similar thing where I give them a dropdown of certain elements (e.g. figures, procedures, tables with titles) and a Filter field. Then below the form display the titles of all the figures and let them filter the results by a regex in the filter field. Click on a result and you're taken to it.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support