Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Adding unique key to Nodes to make Parent Child relationship

$
0
0

Hello All,

What I am trying to do is create an id tag with an number that will act as a primary key to link the <envelope> tag with all the tags it should have like <person> <contact> <address> <notice> <account> <share> and so on. I want to be able to query the data in Access but the data does not import very well. Does anyone have any ideas? I am new to this just need some direction.

XML Document:

<noticeProduction type="c" xmlns="http://www.example.com" revision="2015-11-10"><prologue type="c"><institutionId>22</institutionId><institutionName>Test INC</institutionName><databaseName>testdb</databaseName><terminology option="S">Savings and Checking</terminology><impoundTerminology option="E">Escrow</impoundTerminology><productionDate>2016-21-03</productionDate><productionTime>2016-21-15 23:52:33 EDT</productionTime><reportTitle>Maturity Notice Production</reportTitle><currentCutoffNoticeProductionSerial>1345</currentCutoffNoticeProductionSerial><priorCutoffNoticeProductionSerial>345</priorCutoffNoticeProductionSerial></prologue><envelope type="a"><person type="a"><serial>5432</serial><personLinkCategory option="PR">Primary owner</personLinkCategory><firstName>Lynn</firstName><lastName>Tanner</lastName><contact type="a"><serial>5677</serial><category option="BP">Business phone</category><value>(345)234-1190</value></contact><contact type="a"><serial>2456</serial><category option="PE">Personal email</category><value>ltanner4534@eirco423.net</value></contact><contact type="a"><serial>1135</serial><category option="HP">Home phone</category><value>(614)455-6778</value></contact></person><person type="a"><serial>5805</serial><personLinkCategory option="JT">Joint owner</personLinkCategory><firstName>Ultra</firstName><lastName>Tanner</lastName></person><address type="c"><serial>2456</serial><addressSerial>4070</addressSerial><category option="R">Residence</category><street>43 Times Ping Two Rail Lane</street><city>Thomas Co Commons Oreland</city></address><notice type="a"><serial>1587</serial><category option="F">Force pay</category><account type="c"><serial>4358</serial><accountNumber>0000000000</accountNumber><eStatementOption option="E">E-statement only</eStatementOption><eStatementEmailAddress>tay3456fgee@eircom.net</eStatementEmailAddress><share type="c"><serial>35688</serial><id>0004</id><description>Checking</description><typeSerial>6</typeSerial><typeDescription>Checking</typeDescription></share></account><transactionSerial>98432123</transactionSerial><monetarySerial>34563221</monetarySerial><postingDate>2016-21-02</postingDate><effectiveDate>2016-21-02</effectiveDate><effectiveBalance>19.72</effectiveBalance><effectiveBalanceResult>-1260.28</effectiveBalanceResult><availableBalance>19.72</availableBalance><availableBalanceResult>-1260.28</availableBalanceResult><feePostAmount>30.00</feePostAmount><feeDescription>Overdraft Fee</feeDescription><item type="a"><serial>2378</serial><postingItemSerial>6532</postingItemSerial><category option="W">Withdrawal</category><source option="a">ACH</source><description>BANK OF AMERICA</description><amount>1250.00</amount></item></notice></envelope><epilogue type="c"><envelopeCount>825</envelopeCount><noticeCount>1478</noticeCount></epilogue></noticeProduction>

XSLT DOcument:

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><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:stylesheet>

What I want my xml document to look like:

<noticeProduction type="c" xmlns="http://www.example.com" revision="2015-11-10"><prologue type="c"><institutionId>22</institutionId><institutionName>Test INC</institutionName><databaseName>testdb</databaseName><terminology option="S">Savings and Checking</terminology><impoundTerminology option="E">Escrow</impoundTerminology><productionDate>2016-21-03</productionDate><productionTime>2016-21-15 23:52:33 EDT</productionTime><reportTitle>Maturity Notice Production</reportTitle><currentCutoffNoticeProductionSerial>1345</currentCutoffNoticeProductionSerial><priorCutoffNoticeProductionSerial>345</priorCutoffNoticeProductionSerial></prologue><envelope type="a"><id>1098333113</id><person type="a"><id>1098333113</id><serial>5432</serial><personLinkCategory option="PR">Primary owner</personLinkCategory><firstName>Lynn</firstName><lastName>Tanner</lastName><contact type="a"><id>1098333113</id><serial>5677</serial><category option="BP">Business phone</category><value>(345)234-1190</value></contact><contact type="a"><id>1098333113</id><serial>2456</serial><category option="PE">Personal email</category><value>ltanner4534@eirco423.net</value></contact><contact type="a"><id>1098333113</id><serial>1135</serial><category option="HP">Home phone</category><value>(614)455-6778</value></contact></person><person type="a"><id>1098333113</id><serial>5805</serial><personLinkCategory option="JT">Joint owner</personLinkCategory><firstName>Ultra</firstName><lastName>Tanner</lastName></person><address type="c"><id>1098333113</id><serial>2456</serial><addressSerial>4070</addressSerial><category option="R">Residence</category><street>43 Times Ping Two Rail Lane</street><city>Thomas Co Commons Oreland</city></address><notice type="a"><id>1098333113</id><serial>1587</serial><category option="F">Force pay</category><account type="c"><id>1098333113</id><serial>4358</serial><accountNumber>0000000000</accountNumber><eStatementOption option="E">E-statement only</eStatementOption><eStatementEmailAddress>tay3456fgee@eircom.net</eStatementEmailAddress><share type="c"><id>1098333113</id><serial>35688</serial><id>0004</id><description>Checking</description><typeSerial>6</typeSerial><typeDescription>Checking</typeDescription></share></account><transactionSerial>98432123</transactionSerial><monetarySerial>34563221</monetarySerial><postingDate>2016-21-02</postingDate><effectiveDate>2016-21-02</effectiveDate><effectiveBalance>19.72</effectiveBalance><effectiveBalanceResult>-1260.28</effectiveBalanceResult><availableBalance>19.72</availableBalance><availableBalanceResult>-1260.28</availableBalanceResult><feePostAmount>30.00</feePostAmount><feeDescription>Overdraft Fee</feeDescription><item type="a"><id>1098333113</id><serial>2378</serial><postingItemSerial>6532</postingItemSerial><category option="W">Withdrawal</category><source option="a">ACH</source><description>BANK OF AMERICA</description><amount>1250.00</amount></item></notice></envelope><epilogue type="c"><envelopeCount>825</envelopeCount><noticeCount>1478</noticeCount></epilogue></noticeProduction>


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>