13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

of <strong>XML</strong> source code, you might want to use a more direct <strong>in</strong>struction: .If you plan to use the <strong>in</strong>struction, you must first give the targettemplate a name. For example, the follow<strong>in</strong>g code def<strong>in</strong>es a template namedEmployeeIdTemplate:How do you call <strong>in</strong>to this template? Just use the follow<strong>in</strong>g code:There is one difference you should be aware of. With , you usethe select attribute to select a node-set <strong>for</strong> the template, as shown here:As a result, the template works on the node and retrieves the value withthe follow<strong>in</strong>g expression:When you use the <strong>in</strong>struction, on the other hand, you call thetemplate by name, but it works on the currently selected context node. The ongo<strong>in</strong>gcontext node is , and you must explicitly <strong>in</strong>dicate the child node <strong>in</strong> the bodyof , as shown here:From Schema to SchemaTrans<strong>for</strong>m<strong>in</strong>g an <strong>XML</strong> document <strong>in</strong>to an <strong>XML</strong> document with another schema is <strong>in</strong> noway different from trans<strong>for</strong>m<strong>in</strong>g <strong>XML</strong> <strong>in</strong>to HTML. The real difference is that you useanother target <strong>XML</strong> vocabulary.The follow<strong>in</strong>g XSLT script is designed to simplify the structure of our sample data.xmlfile. The orig<strong>in</strong>al file is structured like this:……247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!