Why does it skip the uneven numbers?
Because while you were at the /
level, you said:
<xsl:apply-templates/>
which applies templates to all nodes children of the root node, and (due to the built-in template rules) to all of their descendants – including the text nodes that separate the <a>
elements.
You will get a different result with an input of:
<?xml version="1.0" encoding="UTF-8"?> <test><a>blah</a><a>blah</a><a>blah</a><a>blah</a></test>
or if you add an instruction to your stylesheet to:
<xsl:strip-space elements="*"/>
or if you apply templates selectively, e.g.
<xsl:apply-templates select="//a"/>
Related Posts:
- XSLT-FO for-each
- XSLT for each loop on simple XML
- How to fix error: The markup in the document following the root element must be well-formed
- How to implement if-else statement in XSLT?
- How do I comment out a block of tags in XML?
- What does
- How to use XPath contains() here?
- Looking for a clear description of Excel’s .xlsx XML format
- Parse XML using JavaScript [duplicate]
- (Python) AttributeError: ‘NoneType’ object has no attribute ‘text’
- java.net.MalformedURLException: no protocol
- Meaning of –
- Is XML a programming language?
- XML Parsing Error: not well-formed
- XPath: Get parent node from child node
- What is the difference between Inclusive and Exclusive OR?
- Manifest Merger failed with multiple errors in Android Studio
- xmlns, xmlns:xsi, xsi:schemaLocation, and targetNamespace?
- How can I escape “&” in XML?
- What’s “tools:context” in Android layout files?
- How to add a newline (line break) in XML file?
- Error -1072896636 “DTD Prohibited” when opening xml file in Excel, what do I do?
- How to define xsi:type as an attribute in XML-schema?
- What are invalid characters in XML
- Error: The processing instruction target matching “[xX][mM][lL]” is not allowed
- The ‘packages’ element is not declared
- Getting attribute using XPath
- android.support.design.widget.CoordinatorLayout error
- How to parse XML in Bash?
- YAML compared to XML
- URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs) in applicationContext.xml
- XSLT Transform XML with Namespaces
- Import WordPress xml file larger than 8mb
- parse XML from URL (via SOAP)
- How can I bulk update all posts without making changes?
- Problems with creating hook that updates XML
- Features in Houzez are not loading in Backend from API
- WP All Import: Feeds of Feeds [closed]
- Is there an XML Web Service that can get posts, categories and other data from the site?
- Receive error exception using xampp with wordpress
- Work with xml file and WordPress
- Moving WordPress to a different directory – update XML Post File?
- WordPress importer / problem with images
- I need a standalone script in web root but still have access to the database
- stop duplicate post
- Importing feeds with PHP
- Create XML sitemap in wordpress
- How to make an xml file (just the xml file) available at a specific url?
- problem of path with xml file
- xml generator script wordpress [closed]
- How to pretty print XML from the command line?
- What does “xmlns” in XML mean?
- How to convert JSON to XML or XML to JSON?
- What characters do I need to escape in XML documents?
- “Content is not allowed in prolog” when parsing perfectly valid XML on GAE
- Text editor to open big (giant, huge, large) text files
- Converting XML to JSON using Python?
- How to convert an XML string to a dictionary?
- ‘xmlParseEntityRef: no name’ warnings while loading xml into a php file
- HTTP Status 500 Error instantiating servlet class
- XmlSerializer – There was an error reflecting type
- No module named urllib3
- How to make layout with rounded corners..?
- Manifest Merger failed with multiple errors in Android Studio
- Python code to remove HTML tags from a string
- Http status 401 This request requires HTTP authentication (). in tomcat 6
- Android Studio 2.2.3: Gradle project sync failed. Basic functionality (e.g. editting, debugging) will not work properly
- In Java, how do I parse XML as a String instead of a file?
- How to add post featured image to RSS item tag?
- With WordPress Importer, why can’t I import post meta containing a multi-dimensional array, in which value(s) of that array contain line breaks?
- Localizing text from XML files
- How do I Import an RSS feed as WordPress posts without duplicates?
- How to get a Google maps SQL->XML->map marker tutorial to work in WordPress
- $wpdb -> Batch insert from XML File?
- Search XML file from within WordPress?
- Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin
- WP All Import manual Cron
- How to split links generated into an xml sitemap to avoid exceeding 30 sec maximum execution time?
- Visual/Text Editor displays blank pages in WP-Admin- but HTML on client side displays correctly
- Display image from an external rss feed on wordpress without plugins
- A question on WXR
- Problems with WordPress Import
- Rss error in first line of xml : not well-formed (invalid token)
- Retrieve Plugin Settings and insert into XML string
- Import External XML
- Import media (.xml) does not attribute featured images to posts
- Unlimited false pages showing in Sitemap?
- SimpleXML is not working with xml response from external api
- WP All import sale price 0 [closed]
- XML file import for attachments or featured images
- Dynamically Create Posts Via XML File
- Create a file format (csv,json,etc) when save/update a Post
- Prevent site down when importing data from large XML file
- accessing my mu-plugins from within a template file
- Pagination options using xml data instead of database?
- Moving 2 wordpress sites to one
- mysql_real_escape_string() error using xml2ary in WordPress plugin
- special XML to wordpress posts
- Create plugin/function to catch XML-data via Shortcode
- WordPress Feed Error [closed]