0

当谈到 XML/XSLT 电子邮件构建时,我是相当绿色的。我无法弄清楚如何正确调用“CampaignName”并将其放入标签中。

我的 XML 是这样的:

<KANARoot>
<EventRequest Id="" CompanyName="default" CampaignName="Statement_Notification">
<Customer  KeyField="alt_customer_id" alt_customer_id="-1" EmailAddress="customer@gmail.com" First_Name="Customer" Last_Name="Name" Address_Line1="" Address_Line2="" City="" State="" Postal_Code="">
<CustomerAttribute      Name="workOrder"/>
<CustomerAttribute      Name="soaMessageId">10</CustomerAttribute>
<CustomerAttribute      Name="accountType">R</CustomerAttribute>
<CustomerAttribute      Name="accountEsbNamespace">8448200010063009</CustomerAttribute>
<CustomerAttribute      Name="billingID">202</CustomerAttribute>
<CustomerAttribute      Name="divisionId">CAR</CustomerAttribute>
<CustomerAttribute      Name="workOrderTimestamp">2013-01-31T10:01:41.109-05:00</CustomerAttribute>
</Customer>
<Event CampaignName="Statement_Notification">
<ExternalXML>
<CustomerInfo>
<CustomerName>Customer Name</CustomerName>
<CustomerBusinessName>Customer</CustomerBusinessName>
<PaperLessFlag>Paperless</PaperLessFlag>
<CustomerEmailAddress>sandhya@gmai.com</CustomerEmailAddress>
</CustomerInfo>
<StatementInfo>
<AccountNumber>8448200000000001</AccountNumber>
<StatementCode/>
<StatementDate>01/31/2013</StatementDate>
<StatementDueDate>01/31/2013</StatementDueDate>
<StatementFromDate>01/31/2013</StatementFromDate>
<StatementToDate>01/31/2013</StatementToDate>
<AmountDue>1000.00</AmountDue>
</StatementInfo>
<DivisionInfo>
<DivisionID>CAR.202</DivisionID>
<BillingSystem>ACP</BillingSystem>
</DivisionInfo>
</ExternalXML>
</Event>
</EventRequest>

到目前为止,我的 XLST 是:

<title><xsl:value-of select="EventRequest/Event/CampaignName" /></title>

但这行不通。谢谢你的帮助。

4

1 回答 1

0

CampaignName是一个属性,而不是 的子元素Event,因此您需要一个 XPath,例如EventRequest/Event/@CampaignName

于 2013-03-06T17:17:50.803 回答