Groups | Blog | Home
all groups > sql server notification services > september 2004 >

sql server notification services : selecting templates from XSLT



sanjay
9/28/2004 11:05:47 PM
Hi All,

How NS selects one template from the many i specify in my
XSLT.

Regards,

Joe Webb
9/29/2004 4:26:34 PM

From BOL:

Information about the subscriber locale and device type of the recipient
is supplied to the content formatter as part of the notification data.
The subscriber locale is identified using the set of locale strings that
are shipped with Notification Services. The device type is identified
using the set of devices supported by the application, as specified by
the developer.

These values are not directly available to you to use in the XSLT file.
Notification Services uses them to select from among the XSLT files that
you provide, based on the XSLT file location.

The base directory that you specify in the application definition file
(ADF) is the root directory under which your XSLT files are found. The
XSLT file can reside in a subdirectory of the base directory, to allow
for specific transforms based on locale and device type.

Notification Services expects to find one subdirectory under the base
directory for each combination of locale and device type that is to have
a specific transformation. These directories should follow this format:

XSLTBaseDirectory\SubscriberLocale\DeviceType
The subscriber locale and device type elements are optional.




HTH...
Joe Webb

~~~
Get up to speed quickly with SQLNS
http://www.mannpublishing.com/Catalog/BookDetail.aspx?BookID=6



[quoted text, click to view]
katardh NO[at]SPAM yahoo.com
9/29/2004 7:43:20 PM
Sanjay,

It seems like you are confusing the templates that go inside an XSLT
file with the choice of different XSLT files that your application can
process. I am listing some key points. Hope they help.


1) Notification Services knows only which xslt file to pick. Once it
picks a xslt file, Notification Services does not care what templates
are defined in the file, or what your XSLT file looks like.
2) You can only specify one XSLT file name in your ADF file. You have
to create multiple xslt files with the same name and arrange them in a
specified folder structure for NS to pick the one you want it to
process. Look at an example below:

If you are supporting three cultures (en, en-us, and fr) and you
specified Sanjay.xslt as your xslt file in appADF.xml, this is what
you folder structure will look like starting from your base default
directory :

-> Sanjay.xslt <file>
->en <folder>
->Sanjay.xslt <file>
->en-US <folder>
->Sanjay.xslt <file>
->fr <folder>
->Sanjay.xslt <file>


This way, if your subscription has a locale setting of fr, then the
Sanjay.xslt file under the fr folder will be processed, and if it has
a locale setting of en-US, then the one under the en-us folder will be
processed.

Same folder structure would apply if you have different Devices.




[quoted text, click to view]
Sanjay
10/3/2004 9:52:19 PM

Thanks for ur prompt reply.


*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button