Profile

outlier_lynn: (Default)
outlier_lynn

January 2015

S M T W T F S
    123
45678910
11121314151617
181920 21222324
25262728293031

Most Popular Tags

Expand Cut Tags

No cut tags
Thursday, November 20th, 2014 09:14 am
I work with xslt and formatting objects even though I really would rather chew off my own leg.

I'm working with xml that has a node "Person" which is a child of "Subject". "Person" has many children, two of which are "PersonName" and "PersionBirthDate".

There is another node called "PersonAlias". This node has two children: "PersonName" and "PersonBirthDate".

Looks something like this:
<subject>
 <person>
    <personname><personfullname>Outlier_Lynn</personfullname></personname>
    <personbirthdate>1949-06-27</personbirthdate>
 </person>
 <personalias>
    <personname></personname>
    <personbirthdate></personbirthdate>
 </personalias>
</subject>

I created a template that was suppose to create a string: "Alias(es): alias1, alias2, ..."
What I got was "Alias(es): alias1, ,Dob: dateAlias2, , Dob: date ..."

When I apply-templates select="PersonAlias", it gave me the dob even though I had not asked for it. Two hours later, I noticed that my PersonAlias template WAS NOT a match template, but, rather, an name template.

I learned something new. If a apply-templates does not find a corresponding match, it goes for the children of the node. And I have match templates for PersonName and PersonBirthDate.

Sigh.
Tags:

Reply

From:
Anonymous (will be screened)
OpenID (will be screened if not validated)
Identity URL: 
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.