Possible to include other tags in a XSLT file?

Is it possible to include addition tags in a XSLT file, that the XSLT
processor will, for all practical purposes, ignore?

What I'm looking to do is to include a section to contain information
regarding what parameters the XSLT file is expecting.  Then my program can
retrieve the information from the style sheet and prompt the user for the
necessary parameters.  I'm envisioning the section would be something like
this:

        <myParameters>
            <Param name="City" prompt="City to search for" />
            <Param name="State" prompt="State to search for" />
        </myParameters>

TIA,

Richard Rosenheim


0
1/31/2005 11:11:03 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
700 Views

Similar Articles

[PageSpeed] 18

Richard L Rosenheim wrote:
> Is it possible to include addition tags in a XSLT file, that the XSLT
> processor will, for all practical purposes, ignore?
> 
> What I'm looking to do is to include a section to contain information
> regarding what parameters the XSLT file is expecting.  Then my program can
> retrieve the information from the style sheet and prompt the user for the
> necessary parameters.  I'm envisioning the section would be something like
> this:
> 
>         <myParameters>
>             <Param name="City" prompt="City to search for" />
>             <Param name="State" prompt="State to search for" />
>         </myParameters>

Sure you can do it. XSLT spec explicitly allows elements in non-XSLT 
namespaces (excluding empty namespace) to be at stylesheet's top level 
(children of xsl:stylesheet). That's quite common XSLT technique usually 
called embedded lookup table:

<xsl:stylesheet ... xmlns:my="http://my.com">
   <my:Parameters>
     <Param name="City" prompt="City to search for" />
     <Param name="State" prompt="State to search for" />
   </my:Parameters>
....

And then you can query this embedded XML content using document() 
function with empty string as an argument:

<xsl:variable name="term" select="'City'"/>
<xsl:value-of 
select="document('')/*/my:Parameters/Param[@name=$term]/@prompt"/>

-- 
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
0
Oleg
1/31/2005 1:46:20 PM
Thanks..it works (after correcting my typing mistakes :) ) !

Richard Rosenheim


"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:ObSmXt5BFHA.3592@TK2MSFTNGP09.phx.gbl...
> Richard L Rosenheim wrote:
> > Is it possible to include addition tags in a XSLT file, that the XSLT
> > processor will, for all practical purposes, ignore?
> >
> > What I'm looking to do is to include a section to contain information
> > regarding what parameters the XSLT file is expecting.  Then my program
can
> > retrieve the information from the style sheet and prompt the user for
the
> > necessary parameters.  I'm envisioning the section would be something
like
> > this:
> >
> >         <myParameters>
> >             <Param name="City" prompt="City to search for" />
> >             <Param name="State" prompt="State to search for" />
> >         </myParameters>
>
> Sure you can do it. XSLT spec explicitly allows elements in non-XSLT
> namespaces (excluding empty namespace) to be at stylesheet's top level
> (children of xsl:stylesheet). That's quite common XSLT technique usually
> called embedded lookup table:
>
> <xsl:stylesheet ... xmlns:my="http://my.com">
>    <my:Parameters>
>      <Param name="City" prompt="City to search for" />
>      <Param name="State" prompt="State to search for" />
>    </my:Parameters>
> ...
>
> And then you can query this embedded XML content using document()
> function with empty string as an argument:
>
> <xsl:variable name="term" select="'City'"/>
> <xsl:value-of
> select="document('')/*/my:Parameters/Param[@name=$term]/@prompt"/>
>
> -- 
> Oleg Tkachenko [XML MVP, MCP]
> http://blog.tkachenko.com


0
1/31/2005 6:24:25 PM
Reply:

Similar Artilces:

File formats
I have a question concerning file formats. As a small business manager using personal computers in the workplace is essential. Over the course of any fiscal year documents are generated and files produced which are important for maintaining from year to year. Often these important files are generated in Microsoft Word and Excel in my work. I recently referred to one such file that was 5 years old to see the frightening words: “File Error: data may have been lost.” My question related to which file formats are best for file retention. I am not interested in paying a com...

Read XML file as an Access table?
Is there any way to process an XML file as an Access table or does the XML have to be imported to a table first? I did some experiments and XML processing appears to be extremely slow; is there any way to speed it up? Thanks. ...

Problem with the pst file
Hi there, I'm facing a problem in opening a pst file(zile size 2.1GB). I have scanned the file using scanpst.exe several times but the problem still persists. I have also used the tool which minimises the size of the file..but no luck. I really don't know why this problem occurs..is it due to the file size..or one of the mails has got corrupt. Also if by change if iam able to retrieve the file can i export the same to Outlook Express so that the problem doens't arise again..? Thanks in advance. Regards. Avinash Outlook 97-2002 pst-files can only be up to 2GB. You can r...

Is it possible
I would like to know is it possible to make million dollar in the internet, if you have any suggestions, write on my forumhttp://isitpossible.truemillion.comMark...

Files opening with different file names
Good afternoon/morning. Having a strange issue with Excel at present. If a file is sitting on my desktop, called invoices.xls, I click on it to open, and it opens as invoices1 The same happens if I 'explore' to the file. However, if I open excel and then click 'file''open' then click on the file, it opens as invoices.xls. When trying to save invoices1 it will save as invoices1.xls, then if I open this it will open it as invoices11 I'm running Windows 2000 with Excel 2000. Any help/guesswork would be appreciated! It sounds like the default behavior when you ...

Restoring old email from backed up pst file
Not sure if anyone can assist but here goes I had a bit of a problem with a hard drive and thankfully most recent backup was within the previous 3 weeks (personal computer) I had backed up the saved email on outlook as the pst file but when I go to import I get a message "properties for this information service must be defined prior to use". and then when I click on OK the message "The file C:\windows\local settings\application data\microsoft \outlook\backup.pst is not a personal folders file". Of course, nothing happens. Can anyone give me a bit of guidance. Unfortunate...

Problem when creating a data analysis view including a custom fiel
Hi, I am facing a problem when creating a new view based on the MSP_Project_Timsheet cube in Data analysis. We have created a customized field which is an Accounting code related to each task (named Accounting_code_task). (We have also another one with the same data related to the assignments named Accounting_code_assignement). So I try to create a new view with: - Data: actual cost - row field : “Resource list”, Accounting_code_task - Column field: “timesheet period” But nothing appears in place of the actual cost The weird thing is : - when I replace “timesheet period” ...

Personal Folders in OWA
Hello, I have just enabled OWA on our Exchange 2003 SP2 through ISA Server 2004. Is there any way to access personal folders in OWA? Thanks in advance. If by personal folders you mean .pst files, the answer is NO! Sorry. C C wrote: > Hello, > > I have just enabled OWA on our Exchange 2003 SP2 > through ISA Server 2004. Is there any way to > access personal folders in OWA? > > Thanks in advance. > > "C C" <someone@atsbcglobal.net> wrote: >I have just enabled OWA on our Exchange 2003 SP2 >through ISA Server 2004. Is there any way...

Disable Recieving of files
I want to setup a mailbox on my server so that a user can send emails to their home email account, but not be able to recieve. Is this possible? Michael, Could you rephrase the question? I am not sure what you are trying to do. You can setup a contact that will forward e-mails sent to the server to another address. -- Jared Gradle Exchange Support Professional ****** Disclaimer ****** This posting is provided "AS IS" with no warranties, and confers no rights. Note: Please do NOT reply to this e-mail address. It is used for newsgroup purposes only. "Michael San Filippo...

Downloading Statements Directly Not Possible
I have Money 2002 installed on an Win XP Pro SP1 machine. Something happened and I probably did it, that causes the statement downloads not to go directly to the account. Rather they want to be saved in a file and then opened into Money. I then have to delete the download. I have tried several things in order to fix this: 1. I verified the file associations of OFC, OFX were correct. They were. 2. Lowered all my security settings in IE. Even put banks into Trusted site zone. No go. 3. Made new accounts. Didn't help. 4. My IE cache is large (500MB) and regularly cleaned out. 5. I made s...

MRP is not Including for Multi level components
Hi All, I have BoM s with multilevel components, which are including ONLY once in calculating MRP. I have applied MRP Low-Level Code regeneration and run the MRP. Still it is not taking the other levels quantity to through the shortage. Any idea.? Are the subassemblies (mid level components) marked as make items? If they are buy/treat as either items, what is the setting instructing MRP how to handle treat as either items? -- Richard L. Whaley Author / Consultant / MVP Documentation for Software Users For help learning and better using Dynamics GP,... check out our books at http:...

How do I copy a Word File to an email that has numbered lists in
When I send an email and copy a Word Document that has a numbered list in the body such as 1. 2. 3. etc. the numbers for each line disappear in the email message. How can I prevent this? Email messages generally don't preserve formatting. Send the Word doc as an attachment, or (probably better) convert it to pdf and send that. On Feb 23, 4:05=A0pm, Edward P <Edward P...@discussions.microsoft.com> wrote: > When I send an email and copy a Word Document that has a numbered list in= the > body such as 1. =A0 2. =A0 3. =A0etc. the numbers for each line disappea...

.eml file extension
When trying to open an attachment that has a *.eml extension I get the following pop-up error message. "Paint cannot read this file. This file is not a valid bitmap file, or its format is not currently supported." Any suggestions? Regards Rightclick the file, choose Open With... and select Outlook Express. Mark it to set it as the default application for eml-files. Note that this is an Microsoft Office Outlook forum. Outlook Express is family of Internet Explorer and Outlook of the Office family. Here is the link for the right forum http://communities.microsoft.com/newsg...

is this possible? reload a form that is based on a query with new query that is defined in the form.
I have a basic form. The form is based on a query, so when I open the form, a pop comes up where I enter in what I want to query. So instead of 30,0000 records, I get 1-10 records. on the form, I have a text box. I want to be able to enter in what I want to query next and afterupdate have the recordset/form reload with that query instead of my original qeury. I figure this has to be done with VB. I am just starting to learn some VB but I am lost. Any info would be great, thank you. It does. You need to apply the new query or table name, or the sql string to the forms recordsource, then...

embedding Word files in cells of Excel 2003
(I am a beginner with Excel) Each month I send an email with an xls attachment. The xls contains cells which contain quotation reference numbers for Word documents. This is for ISO2000 documentation tracking. Now I also send seperate emails each with the Word quotation attached but I'm being told that when these emails are later opened the attachment is not always present. Is it possible for me to link the quotation to the cell so that after emailing the xls the recipient can open the Word quotation by clicking on the relevant cell? Beemer I'm not sure you could link the ...

MFC and batch files
Greetings, I posted similar topic here few weeks ago. I appreciate the responses. I have succesfully converted a batch file into a MFC dialog based application. Immediate results are a lot faster execution and detailed error reporting. Instead of calling other programs to do the task like a batch file does, I embedded C++ code, MFC and WinAPI functionality to do the same things. However, since this is my first major project, I am certain there is room for improvment by following good software engineering practices. One place where I am encountering trouble is terminating application. S...

Merging excel files
Hello everyone, I have one excel file for every day of the month since June 2003. I would like to create one file per month and merge the daily file into it...is there another way to do it other than copy/paste? Please help there is a lot of files what are the names of your files "Raul V" <pacificinet@aol.com> wrote in message news:0fa401c377e3$026dd5e0$a601280a@phx.gbl... > Hello everyone, I have one excel file for every day of the > month since June 2003. I would like to create one file per > month and merge the daily file into it...is there another > way t...

Search file and within the file
Hi, I have several files in a folder most of them are CVs in word format, I want to create a query or access program to get the subject with some criteria - any ideas? If I search for a particular Text, that should check and matching file name and also inside the word file. I tried google desktop search, coppernic search and even the MS Search - but nothing helped in a way I want. I appreciate your valuable time. Rgds Anver, To develop a bespoke Access application will take much effort and involve using Windows APIs. I suggest you don't want to do this. Instead consider upgrad...

Possible to detect changes to an XmlDocument object?
If I instantiate an XmlDocument object, the load a file through the Load method, is there a way, later on in execution, to easily determine if the XmlDocument object has changed from the original version loaded? I'd like to be able to check a condition to see if the document in memory has been editted (i.e., nodes added, attributes changed, etc.) so that my user can decide whether or not to commit changes to the disk file before moving to another file. Will I have to resort to re-loading the file, and comparing OuterXml properties? Gabe Gabe Covert wrote: > I'd like t...

which file include " IOleCommandTarget"?
hi guys, I want to implement IOleCommandtarget interface using VC6 ATL, but can't find which Typelibray to use for this interface. Thanks in advance! ...

ost files
We have people that use Outlook 2003 with an Exchange account. The Exchange acounts are hosted by our ISP. I want to know what is the best practice to backup et restore the Outlook 2003 files with an Exchange account. Let say a user has accidently deleted a folder in the Inbox and I want to restore it. With an Exchage account, the outlook file format is ost. Can I backup and resotre juste the ost file. Thanks for your response -- Shidewa Assuming that the Exchange application service provider has deleted item retention turned on, you should be able to use the dumpsteralwayson registry ...

Export Access Data Project Queries to old Access .mdb file
I want to copy Access Data Project queries from a project into a new .mdb file. What is the best way to do this? In the new .mdb go to the menu bar, click file, Get external data, and Import. Select the orignal .mdb file and then the items. >-----Original Message----- >I want to copy Access Data Project queries from a project into a new .mdb >file. What is the best way to do this? >. > ...

Error msg "The system cannot find the file specified"
Hello all, I'm using MS Outlook 2000. I have received an above alert from Outlook when I tried to open the attachment (excel file only)in mail folders. For other file types(such as .doc, .jpg, .tif...) I can open easily. Would be much appreciated if you can help me to solve the problem. Thanks and best regards Tuan ...

lost file #4
I have been using plantlist.xls for months. Today it will not open stating that a document of the same name is open & that I must close it or rename it. I have shut down Excel and restarted the computer but I get the same message. HELP! All other Excel programs open just fine. JL You may have to re-register Excel. See Debra Dalgleish's site for more info on this problem. http://www.contextures.on.ca/xlfaqApp.html#AlreadyOpen Gord Dibben MS Excel MVP On Fri, 13 Jan 2006 00:10:02 -0800, "JL Ecklund" <JL Ecklund@discussions.microsoft.com> wrote: >I have been...

Is it possible to compare a string and a field name
I have the following tables: Membership, Subscriptions, OfficeUseOnly. The Office Table contains a Year, Year To and From [financial year] and the other fields are the 5 membership types (regular, student etc) and these 5 fields contain the different amount each type of member has to pay. I want to create a form whereby on entering the financial year and the membership type the correct amount is automatically inserted into the 'Amount' field: FinancialYear - in current form = OfficeUseOnly SubsFinYear and then if MemberType = 'Student' find Student field ...