- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
barcode generator github c# BUILDING XSLT APPLICATIONS in Font
CHAPTER 12 BUILDING XSLT APPLICATIONS Encode PDF-417 2d Barcode In None Using Barcode encoder for Font Control to generate, create PDF 417 image in Font applications. www.OnBarcode.comBarcode Maker In None Using Barcode maker for Font Control to generate, create Barcode image in Font applications. www.OnBarcode.comIf you haven t provided a second argument, then the XSLT processor will assume that the file is encoded as UTF-8 and interpret it accordingly. For example, to access the content of disclaimer.html as a string, with a default encoding of ISO-8859-1, you would use unparsed-text('disclaimer.html', 'ISO-8859-1') Create European Article Number 13 In None Using Barcode drawer for Font Control to generate, create EAN-13 Supplement 5 image in Font applications. www.OnBarcode.comCreate PDF-417 2d Barcode In None Using Barcode drawer for Font Control to generate, create PDF 417 image in Font applications. www.OnBarcode.com Summary You can use the unparsed-text() function to access external text documents as a string. The first argument is the location of the text file, and the optional second argument is the default encoding for the file, used if no other information is available about its encoding. UCC - 12 Generator In None Using Barcode encoder for Font Control to generate, create EAN / UCC - 14 image in Font applications. www.OnBarcode.comCode 3/9 Creation In None Using Barcode encoder for Font Control to generate, create Code 3/9 image in Font applications. www.OnBarcode.comUnavailable Documents
UPC-A Supplement 2 Creation In None Using Barcode drawer for Font Control to generate, create UPC-A image in Font applications. www.OnBarcode.comPrint MSI Plessey In None Using Barcode creator for Font Control to generate, create MSI Plessey image in Font applications. www.OnBarcode.comIf the processor has any problems locating the document that you ve specified when using the document() or unparsed-text() functions, then the processor can either return an empty sequence (or string for the unparsed-text() function) or halt the transformation altogether. The same thing happens if the document you point to with the document() functions turns out not to be an XML document. Most processors halt the transformation in these circumstances. Processors will also halt if the file you refer to with the doc() function isn t available or isn t an XML document. All this means you have to be quite careful that the file paths that you use do actually point to an existing document. You can test whether an XML document is actually available at a particular location using the doc-available() function. This takes a string URI as an argument and returns true if there s an XML document at that location and false if not. Usually, then, you would wrap a call to doc() or document() within an if statement that tested for the presence of an XML document before accessing it, and returned something useful (such as an empty sequence) if the document itself isn t available. For example: if (doc-available('flags.xml')) then doc('flags.xml') else () The doc-available() function isn t suitable for testing for the presence of documents you re going to open with unparsed-text(), since these documents usually aren t XML documents and therefore doc-available() will return false for them. Instead, the unparsed-text-available() function has a similar purpose: it takes a URI and, optionally, an encoding, and tests whether the document specified by the URI is readable. For example: if (unparsed-text-available('disclaimer.html', 'ISO-8859-1')) then unparsed-text('disclaimer.html', 'ISO-8859-1') else '' PDF-417 2d Barcode Drawer In Java Using Barcode generation for Java Control to generate, create PDF417 image in Java applications. www.OnBarcode.comPDF-417 2d Barcode Drawer In Java Using Barcode creator for Android Control to generate, create PDF417 image in Android applications. www.OnBarcode.com Summary The transformation will usually halt if the external document that you ve indicated cannot be opened. The doc-available() and unparsed-text-available() functions allow you to test whether doc(), document(), or unparsed-text() will actually work. Encode Code 128C In Java Using Barcode creation for Java Control to generate, create Code 128 Code Set B image in Java applications. www.OnBarcode.comPrinting PDF-417 2d Barcode In Java Using Barcode generator for Java Control to generate, create PDF417 image in Java applications. www.OnBarcode.comCHAPTER 12 BUILDING XSLT APPLICATIONS
Barcode Printer In Java Using Barcode drawer for Eclipse BIRT Control to generate, create Barcode image in BIRT reports applications. www.OnBarcode.comPDF 417 Maker In None Using Barcode generator for Microsoft Excel Control to generate, create PDF417 image in Excel applications. www.OnBarcode.comUsing Information from an External XML Document
QR Code Scanner In None Using Barcode recognizer for Software Control to read, scan read, scan image in Software applications. www.OnBarcode.comCode 128 Code Set A Generator In .NET Framework Using Barcode drawer for ASP.NET Control to generate, create ANSI/AIM Code 128 image in ASP.NET applications. www.OnBarcode.comTo test out using information from external XML documents, we ll try to use the information from flags.xml to create the <img> element shown next to a program. The flags.xml document looks like <flags> <flag name="favorite" src="favorite.gif" alt="Favorite" /> <flag name="interesting" src="interest.gif" alt="Interest" /> </flags> In TVGuide5.xsl, when we process a program using the template matching <Program> elements in Details mode, we use the following code: <xsl:if test="@flag"> <img src="{if (@flag = 'favorite') then 'favorite' else 'interest'}.gif" alt="[{if (@flag = 'favorite') then 'Favorite' else 'Interest'}]" width="20" height="20" /> </xsl:if> Instead, in TVGuide6.xsl, we can try to retrieve the relevant <flag> element from the flags.xml document, and then process it to produce the flag graphic. The relevant <flag> element is the one whose name attribute has the same value as the value of the flag attribute of the current <Program> element: document('flags.xml')/flags/flag[@name = current()/@flag] If we simply apply templates to this <flag> element, then we won t get a graphic if no <flag> element was found, which is precisely what we want. So rather than testing whether a flag attribute is present, we can just apply templates to the <flag> element from the flags.xml document: <xsl:apply-templates select="document('flags.xml')/flags/flag[@name = current()/@flag]" /> Then we need a template that matches the <flag> element and produces the relevant <img> element. The value of the src attribute comes from the src attribute on the <flag> element, and the value of the alt attribute comes from the alt attribute on the <flag> element (you could simply copy them if you prefer): <xsl:template match="flag"> <img src="{@src}" alt="{@alt}" width="20" height="20" /> </xsl:template> The result of transforming TVGuide.xml with TVGuide6.xsl is TVGuide6.html, which is shown in Figure 12-9. Printing QR Code In None Using Barcode creation for Office Excel Control to generate, create QR image in Microsoft Excel applications. www.OnBarcode.comGS1 - 12 Maker In VS .NET Using Barcode creation for ASP.NET Control to generate, create UPC Symbol image in ASP.NET applications. www.OnBarcode.comBarcode Creation In None Using Barcode creation for Software Control to generate, create Barcode image in Software applications. www.OnBarcode.comECC200 Encoder In Visual C#.NET Using Barcode printer for .NET framework Control to generate, create Data Matrix ECC200 image in VS .NET applications. www.OnBarcode.com |
|