我试着从前面的一个类似问题中调整一些代码,但是我的尝试似乎是没有希望的,因为它甚至没有从'activity'表中提取任何信息,但是它在'cstactivity'表中创建了'attid'字段,我想我最终可以达到这个目的,以便跨表进行连接/链接。唯一的问题是它实际上没有用相关的ID填充这个!
但理想情况下,我只想转换数据,以便导入仅包括“activity”节点上相关行中嵌套节点中的所有内容。
要导入的xml:
<?xml version="1.0" encoding="utf-8"?>
<ns:HCDSExtract xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://Improvement.nhs.uk/HealthcareCostingDataSet/v03-1819">
<ns:MessageHeader>
<ns:OrgSubmittingID>RRK</ns:OrgSubmittingID>
<ns:FinYr>FY2018-19</ns:FinYr>
<ns:PeriodStartDate>2018-05-01</ns:PeriodStartDate>
<ns:PeriodEndDate>2018-05-31</ns:PeriodEndDate>
<ns:CreateDateTime>2018-03-28T18:25:04</ns:CreateDateTime>
<ns:FeedType>OP</ns:FeedType>
<ns:NoOfActivityRecords>10</ns:NoOfActivityRecords>
<ns:TotalCosts>100.000</ns:TotalCosts>
</ns:MessageHeader>
<ns:MessageBody>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503898066984</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503898066984</ns:AttID>
<ns:HRG>WF01A</ns:HRG>
<ns:AppDte>2018-05-11T14:29:00</ns:AppDte>
<ns:Tfc>172</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true" />
<ns:PatOrgId xsi:nil="true" />
<ns:CstActivity>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1440</ns:ActCnt>
<ns:Resource>
<ns:ResCstID>CPF005</ns:ResCstID>
<ns:TotCst>10.00000000</ns:TotCst>
</ns:Resource>
</ns:CstActivity>
</ns:Activity>
</ns:MessageBody>
</ns:HCDSExtract>
<xsl:stylesheet version="1.0" xmlns:ns="http://Improvement.nhs.uk/HealthcareCostingDataSet/v03-1819" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<dataroot>
<xsl:apply-templates select="@*|node()"/>
</dataroot>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns:Activity">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
<xsl:template match="ns:CstActivity">
<ns:CstActivity>
<ns:AttID><xsl:value-of select="../ns:AttID"/></ns:AttID>
<xsl:apply-templates select="@*|node()"/>
</ns:CstActivity>
</xsl:template>
</xsl:stylesheet>
下面是我的新xsl:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://Improvement.nhs.uk/HealthcareCostingDataSet/v03-1819">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns:CstActivity"><xsl:apply-templates /></xsl:template>
<xsl:template match="ns:Resource"><xsl:apply-templates /></xsl:template>
</xsl:stylesheet>
所以我最新的xsl给出了如下输出:
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897890061</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>02</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897890061</ns:AttID>
<ns:HRG>WF01A</ns:HRG>
<ns:AppDte>2018-05-28T17:14:00</ns:AppDte>
<ns:Tfc>306</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>DIM007</ns:ActCstID>
<ns:ActCnt>3</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>10.00000000</ns:TotCst>
不过,这对该部分来说是很好的
<ns:ActCstID>DIM007</ns:ActCstID>
<ns:ActCnt>3</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>10.00000000</ns:TotCst>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897890061</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>02</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897890061</ns:AttID>
<ns:HRG>WF01A</ns:HRG>
<ns:AppDte>2018-05-28T17:14:00</ns:AppDte>
<ns:Tfc>306</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>DIM007</ns:ActCstID>
<ns:ActCnt>3</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>10.00000000</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897890061</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>02</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897890061</ns:AttID>
<ns:HRG>WF01A</ns:HRG>
<ns:AppDte>2018-05-28T17:14:00</ns:AppDte>
<ns:Tfc>306</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>MID127</ns:ActCstID>
<ns:ActCnt>2</ns:ActCnt>
<ns:ResCstID>CPD060</ns:ResCstID>
<ns:TotCst>12.05000000</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true" />
<ns:PatOrgId xsi:nil="true" />
<ns:CstActivity>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:Resource>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.01711470</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF004</ns:ResCstID>
<ns:TotCst>0.00005506</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF011</ns:ResCstID>
<ns:TotCst>0.12799014</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF022</ns:ResCstID>
<ns:TotCst>0.00622135</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF023</ns:ResCstID>
<ns:TotCst>6.55181258</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF024</ns:ResCstID>
<ns:TotCst>0.08211900</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF027</ns:ResCstID>
<ns:TotCst>0.04333875</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CSC004</ns:ResCstID>
<ns:TotCst>18.95493831</ns:TotCst>
</ns:Resource>
</ns:CstActivity>
<ns:CstActivity>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:Resource>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.00000124</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF011</ns:ResCstID>
<ns:TotCst>0.00000148</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF022</ns:ResCstID>
<ns:TotCst>0.00002230</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF023</ns:ResCstID>
<ns:TotCst>-0.00000221</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF024</ns:ResCstID>
<ns:TotCst>0.00017128</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CSC004</ns:ResCstID>
<ns:TotCst>0.16603542</ns:TotCst>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.01711470</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>THR001</ns:ActCstID>
<ns:ActCnt>2</ns:ActCnt>
<ns:ResCstID>CPF004</ns:ResCstID>
<ns:TotCst>0.00005506</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.00000124</ns:TotCst>
</ns:Activity>
所以本质上,对于下面字段的每一个变体,旧的父节点都被引入,所以每个CDSID都有很多行,而不是只有一个。
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.00000124</ns:TotCst>
再次感谢你的帮助。
这里有一个扁平化层次结构的示例,如:
<countries>
<country>
<name>USA</name>
<state>Alabama</state>
<state>Colorado</state>
</country>
</countries>
此样式表:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="countries">
<states>
<xsl:apply-templates select="country/state" mode="uprise"/>
</states>
</xsl:template>
<xsl:template match="state"/>
<xsl:template match="state" mode="uprise">
<xsl:copy>
<name>
<xsl:value-of select="."/>
</name>
<xsl:apply-templates select=".."/>
</xsl:copy>
</xsl:template>
<xsl:template match="country/name">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
输出:
<states>
<state>
<name>Alabama</name>
<country>USA</country>
</state>
<state>
<name>Colorado</name>
<country>USA</country>
</state>
</states>
<ns:HCDSExtract xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns="http://Improvement.nhs.uk/HealthcareCostingDataSet/v03-1819">
<ns:MessageHeader>
<ns:OrgSubmittingID>RRK</ns:OrgSubmittingID>
<ns:FinYr>FY2018-19</ns:FinYr>
<ns:PeriodStartDate>2018-05-01</ns:PeriodStartDate>
<ns:PeriodEndDate>2018-05-31</ns:PeriodEndDate>
<ns:CreateDateTime>2018-03-28T18:25:04</ns:CreateDateTime>
<ns:FeedType>OP</ns:FeedType>
<ns:NoOfActivityRecords>10</ns:NoOfActivityRecords>
<ns:TotalCosts>100.000</ns:TotalCosts>
</ns:MessageHeader>
<ns:MessageBody>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:CstActivity>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:Resource>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.01711470</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF004</ns:ResCstID>
<ns:TotCst>0.00005506</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF011</ns:ResCstID>
<ns:TotCst>0.12799014</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF022</ns:ResCstID>
<ns:TotCst>0.00622135</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF023</ns:ResCstID>
<ns:TotCst>6.55181258</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF024</ns:ResCstID>
<ns:TotCst>0.08211900</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF027</ns:ResCstID>
<ns:TotCst>0.04333875</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CSC004</ns:ResCstID>
<ns:TotCst>18.95493831</ns:TotCst>
</ns:Resource>
</ns:CstActivity>
<ns:CstActivity>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:Resource>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.00000124</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF011</ns:ResCstID>
<ns:TotCst>0.00000148</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF022</ns:ResCstID>
<ns:TotCst>0.00002230</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF023</ns:ResCstID>
<ns:TotCst>-0.00000221</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CPF024</ns:ResCstID>
<ns:TotCst>0.00017128</ns:TotCst>
</ns:Resource>
<ns:Resource>
<ns:ResCstID>CSC004</ns:ResCstID>
<ns:TotCst>0.16603542</ns:TotCst>
</ns:Resource>
</ns:CstActivity>
</ns:Activity>
</ns:MessageBody>
</ns:HCDSExtract>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:ns="http://Improvement.nhs.uk/HealthcareCostingDataSet/v03-1819">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns:MessageBody">
<xsl:copy>
<xsl:apply-templates
select="ns:Activity/ns:CstActivity/ns:Resource" mode="uprise"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns:Resource|ns:CstActivity|ns:MessageHeader"/>
<xsl:template match="ns:Resource" mode="uprise">
<ns:Activity>
<xsl:apply-templates select="../../*|../*"/>
<xsl:apply-templates/>
</ns:Activity>
</xsl:template>
</xsl:stylesheet>
<ns:HCDSExtract xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns="http://Improvement.nhs.uk/HealthcareCostingDataSet/v03-1819">
<ns:MessageBody>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.01711470</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF004</ns:ResCstID>
<ns:TotCst>0.00005506</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF011</ns:ResCstID>
<ns:TotCst>0.12799014</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF022</ns:ResCstID>
<ns:TotCst>0.00622135</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF023</ns:ResCstID>
<ns:TotCst>6.55181258</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF024</ns:ResCstID>
<ns:TotCst>0.08211900</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF027</ns:ResCstID>
<ns:TotCst>0.04333875</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>OUT001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CSC004</ns:ResCstID>
<ns:TotCst>18.95493831</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF002</ns:ResCstID>
<ns:TotCst>0.00000124</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF011</ns:ResCstID>
<ns:TotCst>0.00000148</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF022</ns:ResCstID>
<ns:TotCst>0.00002230</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF023</ns:ResCstID>
<ns:TotCst>-0.00000221</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CPF024</ns:ResCstID>
<ns:TotCst>0.00017128</ns:TotCst>
</ns:Activity>
<ns:Activity>
<ns:OrgId>RRK</ns:OrgId>
<ns:CDSID>503897986301</ns:CDSID>
<ns:NHSNo>1111111111</ns:NHSNo>
<ns:NhsSt>01</ns:NhsSt>
<ns:Postcd>RD15 2AD</ns:Postcd>
<ns:DoB>1967-04-01</ns:DoB>
<ns:Gendr>1</ns:Gendr>
<ns:Pod>NCL</ns:Pod>
<ns:AttID>503897986301</ns:AttID>
<ns:HRG>WF01B</ns:HRG>
<ns:AppDte>2018-05-02T10:19:00</ns:AppDte>
<ns:Tfc>191</ns:Tfc>
<ns:ConCode>C0000000</ns:ConCode>
<ns:PathId xsi:nil="true"/>
<ns:PatOrgId xsi:nil="true"/>
<ns:ActCstID>SUP001</ns:ActCstID>
<ns:ActCnt>1</ns:ActCnt>
<ns:ResCstID>CSC004</ns:ResCstID>
<ns:TotCst>0.16603542</ns:TotCst>
</ns:Activity>
</ns:MessageBody>
</ns:HCDSExtract>
问题内容: 输入XML 输出Json 如何编写通用的xslt样式表,它将输入的xml转换为json 输入可能在根目录下有太多结果,在结果下可能有系统和名称,在系统下还有ID名称和值。 问题答案: 我从此处复制并粘贴的以下XSLT 应该可以帮助您将XML转换为JSON。谢谢 :)
XML输入文件: XML输入文件转换为XML输出文件。将XML输入文件的firstName、middleName和lastName标签合并为XML Ouput文件的name标签,将XML输入文件的address1、address2、city、state和pincode标签合并为XML Ouput文件的address标签。 我几乎转换了代码,但我在这里与empId作斗争。我已经在XSLT文件中手动输
问题内容: 使用MSSQL 2008和XQUERY 考虑以下存储在表中的XML: 我想将此xml分解为类似 等等。 注意:在此示例中,每个ParentElement可能有许多ChildElements。我一直在尝试使用xquery,但是我无法像这样浏览复杂的元素。 基本上,我正尝试与FOR XML对表进行完全相反的操作,只是要使用一组更为简单的数据。 关于下一步或如何实现此目标的任何想法? 谢谢
本文向大家介绍Python将xml和xsl转换为html的方法,包括了Python将xml和xsl转换为html的方法的使用技巧和注意事项,需要的朋友参考一下 本文实例讲述了Python将xml和xsl转换为html的方法。分享给大家供大家参考。具体分析如下: 这里需要用libxml2,所以还要先安装了libxml2模块才能使用。代码如下: 希望本文所述对大家的Python程序设计有所帮助。
输入 json : 预期输出: 我想有一个颠簸转换,它可以嵌套很少的田地。
下面是我的XSL文件的内容: 当我运行我的程序时,输出与原始XML相同。f_name和l_name节点都没有重命名,Version节点值也没有被替换。 任何帮助都将不胜感激。