Re: [xsl] XML attribute value to pattern match of the replace function

Subject: Re: [xsl] XML attribute value to pattern match of the replace function
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 Feb 2010 12:09:18 -0500
At 2010-02-20 21:40 +0530, Mukul Gandhi wrote:
On Sat, Feb 20, 2010 at 9:04 PM, Selvaganesh
<selvaganesh_t@xxxxxxxxxxxxxx> wrote:
> <hov:template match="caseref">

I think, I noticed this earlier too in Selvaganesh's stylesheets :)
Couldn't resist to comment.

A prefix like, "hov" for XSLT language instructions is not a good
practice. Does anybody disagrees with this?

It is not unprecedented to use a prefix other than "xsl", and there is certainly nothing wrong with it. Though it does break with convention I can't think of a technical reason to deprecate it.


Using a prefix other than "xsl" is useful when writing stylesheets that write stylesheets (especially based on the conventions of XSLT 1 engines).

The most common convention, is to use the prefix "xsl" for XSLT
language instructions. The XSLT spec, also uses the prefix "xsl"
within itself.

Only for documentary purposes ... there are no requirements to use that prefix.


Though, it is a common practice to have business specific namespaces
(URIs & prefixes) in the instance documents.

I find using specific prefixes is only useful in documentation. There are 33 different namespaces in the UBL 2.0 vocabulary (55 and counting in UBL 2.1) and for consistency in the documentation the UBL TC has adopted a collection of namespace prefixes. But in no way do we require UBL users to use those prefixes in their XML. Having a documentary convention helps the human reader not have to constantly guess what namespace is being referred to.


But such a convention is only useful to the human reader.

Any XML instance processing based on an expected prefix is wrong because the process has no idea what prefixes the end user is going to use in an arbitrary input XML document.

I hope this helps.

. . . . . . . . . . . . Ken


-- XSLT/XQuery training: after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery training: San Carlos, California 2010-04-26/30 Principles of XSLT for XQuery Writers: San Francisco,CA 2010-05-03 XSLT/XQuery/UBL/Code List training: Trondheim,Norway 2010-06-02/11 Vote for your XML training: http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread