Re: how do you create an xml element attribute with a namespace



On Oct 21, 1:26 pm, Joe Kesselman <keshlam-nos...@xxxxxxxxxxx> wrote:
sqad wrote:
<JiraJelly
xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib">
...something
</JiraJelly>

Anyone know how to create this xml tag using the xsl:element?

1) Why are you using xsl:element rather than a literal result element or
xsl:copy, which are always simpler unless you need to calculate the
element name?

2) If you really must do so... Explicitly issuing namespace declaration
nodes in specific places usingXSLT 1.0 is unfortunately rather awkward.
You can't use xsl:attribute, since namespace declarations are not
considered attributes by the XPath Data Model which XSLT is based on.
About the only way I know of to do this is to copy the desired namespace
node off a node that happens to carry that definition. (XSLT 2.0 fixes
this by providing an explicit directive for the purpose, but there still
aren't many processors available which support 2.0.)

See some of the related discussion inhttp://www.dpawson.co.uk/xsl/sect2/N5536.html#d7594e1318

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry

Hi Joe,

Thank you for your response.

I tried all sort of hacks and realized QName can't contain namspace
declarations. Unfortunately, the root node <JiraJelly> is not part of
the xmlns:jira namespace. I just want to generate this tag in that
exact syntax in the xml document following an xslt transformation.
This is an xml document that's created after run via a XSLT 2.0
parser. This is all done via Java, so if I can't run it via the
transformer, I'll probably have to do this programatically - file
open, string replace, file close...uber ugly solution

/sqad

.



Relevant Pages

  • Re: how do you create an xml element attribute with a namespace
    ... Anyone know how to create this xml tag using the xsl:element? ... Explicitly issuing namespace declaration nodes in specific places usingXSLT 1.0 is unfortunately rather awkward. ... since namespace declarations are not considered attributes by the XPath Data Model which XSLT is based on. ...
    (comp.text.xml)
  • Re: Shorthand for namespaces
    ... XPath and XSLT 1.0 don't have anything to specifically address the default namespace declaration; you must use prefixes to specify namespaced names. ...
    (comp.text.xml)
  • Re: XML Transform
    ... I dont pass the XSLT as a parameter to the C# beacause they are store in the ... same database. ... I have a table that has the XSLT and the information level (we ... we have 3 XSLT that we apply to the XML Document received). ...
    (microsoft.public.sqlserver.xml)
  • Re: XML Transform
    ... same database. ... I have a table that has the XSLT and the information level ... we have 3 XSLT that we apply to the XML Document received). ... Is SQL Server ...
    (microsoft.public.sqlserver.xml)
  • Re: Newbie question about how to solve the use escape characters
    ... > Hi, I am a newbie, I spend quite sometime searching on the web, but I ... > I am trying to convert XML document into another form, ... A more useful form would be ... The following XSLT will do this. ...
    (comp.text.xml)

Loading