Can GUID type attribute value be added to XML doc during XSLT transformation.
  Home FAQ Contact Sign in
microsoft.public.sqlserver.xml only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.sqlserver.xml Profile…
 Up
Can GUID type attribute value be added to XML doc during XSLT transformation.         


Author: Farmer
Date: Sep 10, 2008 09:16

Hi everyone,

I have many documents that contian document identification element like below. There is a schema that defines this element.
This schema is published to customers so that they can create content to be sent to us and imported into our system, with many more content elements.

One attribute docID is GUID type and is required. They have an original XML document of theirs, which ahs no such concept, and claim they have no way to produce/generate/add this docID GUID in XSLT transformation.
I have never used XSL myself so I am not sure.
I wonder if this is true.
Can anyone confirm or disprove this?
Any examples?

4.3.0">



Thank you so much!

Vladimir
Show full article (1.65Kb)
2 Comments
Re: Can GUID type attribute value be added to XML doc during XSLT         


Author: Marcelo Lopez Ruiz - MSFT
Date: Sep 10, 2008 22:29

Farmer, it's true that XSLT has no function to generate a GUID.

If they are processing the transformation using .NET, there is support for
embedding .NET code in the transformation, which would allow them to create a
function that returns the string representation for a GUID. See
http://msdn.microsoft.com/en-us/library/wxaw5z5e.aspx for more on this topic.

If they can't extend their engine, processing this in the server might be
your best bet. You could ask them to use a constant GUID with all zeros to
serve as a flag that you need to update on the server, in case you want them
to be able to validate the documents even before they are submitted.

"Farmer" wrote:
> Anyone in programming group may have an idea, please?
>
> thank you for your time and experience!
>
> or do I need to do something like
>
> IF @xml_identity.exist('/Identity[@docID=" "]') = 1
>
...
Show full article (2.16Kb)
no comments
Re: Can GUID type attribute value be added to XML doc during XSLT         


Author: Farmer
Date: Sep 11, 2008 11:09

Thank you Marcelo.

Very good.

"Marcelo Lopez Ruiz - MSFT" MSFT@discussions.microsoft.com> wrote in message
news:52ADD4E1-CC4D-4DF0-91A5-B9103B40A9DB@microsoft.com...
> Farmer, it's true that XSLT has no function...
Show full article (2.42Kb)
no comments