Trying to add xmlns:xsi attribute to element - attributes

I'm using XSLT 1.0 to produce an XML document where the desired output looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" **xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"**>
...
</Document>
I've tried several things including the following:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>
<xsl:template match="/VendorPayments">
<xsl:element name="Document" namespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
<xsl:attribute name="xsi" namespace="xmlns">http://www.w3.org/2001/XMLSchema-instance</xsl:attribute>
...
</xsl:template>
</xsl:stylesheet>
... and this variation for the xsl:attribute tag:
<xsl:attribute name="xsi" namespace="xmlns">
<xsl:text>http://www.w3.org/2001/XMLSchema-instance</xsl:text>
</xsl:attribute>
... and this one:
<xsl:attribute name="xsi" namespace="xmlns">
<xsl:value-of select="'http://www.w3.org/2001/XMLSchema-instance'"/>
</xsl:attribute>
In every case, my result looks the same:
<?xml version="1.0" encoding="utf-8"?>
<Document xp_0:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xp_0="xmlns">
...
</Document>
I also tried removing the xsl:attribute tag altogether and instead modifying the xsl:stylesheet tag like this:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
... but this produces the following result:
<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
...
</Document>
... which is correct except for the missing xmlns:xsi attribute. I could really use some help here!

Related

XSLT for an XML file

I am trying to extract few tags using XSLT , but tags are getting blank value. Can you please suggest what is the issue with the code.
Below is my code :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ClientID</th>
<th style="text-align:left">AssetClass</th>
</tr>
<tr>
<td><xsl:value-of select="ClientID"/></td>
<td><xsl:value-of select="AssetClass"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Below is the XML from which I am trying to pull the data.
<?xml version="1.0"?>
<template123 xmlns="http://www.markit.com/totem/api/data/V40" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ClientID>470</ClientID>
<ValuationDate>2019-01-31</ValuationDate>
<AssetClass>Value</AssetClass>
<ServiceName>Oil</ServiceName>
<ServiceFrequency>ME</ServiceFrequency>
<SubArea>10</SubArea>
<SchemaVersion>40</SchemaVersion>
<Underlier>
<ContractGroup>Chemicals</ContractGroup>
<Currency>USD</Currency>
<ReferencePublication1>XYZ</ReferencePublication1>
<Underlying>ABC</Underlying>
<Underlying1>ABC</Underlying1>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-02-28</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-02-01</StartDate>
<Units>MT</Units>
<ClientPrice>472.84000000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-03-31</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-03-01</StartDate>
<Units>MT</Units>
<ClientPrice>456.46600000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-04-30</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-04-01</StartDate>
<Units>MT</Units>
<ClientPrice>440.30900000</ClientPrice>
</Instrument>
</Underlier>
</template123>
Have tried with the suggested solution and able to get the parent nodes values but nested node is still coming as blank.
My Updated Code :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ab="http://www.markit.com/totem/api/data/V40">
<xsl:output method="text" />
<xsl:template match="ab:template">
<xsl:text>ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate</xsl:text>
<xsl:text>
</xsl:text>
<xsl:value-of select="ab:ClientID" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ValuationDate" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:AssetClass" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceName" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceFrequency" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SubArea" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SchemaVersion" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/ContractGroup" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/Instrument/EndDate" />
<xsl:text>|</xsl:text>
</xsl:template>
</xsl:stylesheet>
I am trying to extract the data from this XML and convert it into a pipe separated file.
Can you suggest what needs to be changed to access the values from nested nodes.
Expected output should look like as below :
ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate
470|2019-01-31|Value|Oil|ME|10|40|Chemicals|2019-02-28
470|2019-01-31|Value|Oil|ME|10|40|Chemicals|2019-03-31
and so on for all nested nodes.
You can try this
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ab="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="ab">
<xsl:template match="ab:template123">
<html>
<body>
<h2>My Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ClientID</th>
<th style="text-align:left">AssetClass</th>
</tr>
<tr>
<td><xsl:value-of select="ab:ClientID"/></td>
<td><xsl:value-of select="ab:AssetClass"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
DEMO
https://xsltfiddle.liberty-development.net/94AbWB2
XML File:
<?xml version="1.0" encoding="UTF-8"?>
<template123 xmlns="http://www.markit.com/totem/api/data/V40" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ClientID>470</ClientID>
<ValuationDate>2019-01-31</ValuationDate>
<AssetClass>Value</AssetClass>
<ServiceName>Oil</ServiceName>
<ServiceFrequency>ME</ServiceFrequency>
<SubArea>10</SubArea>
<SchemaVersion>40</SchemaVersion>
<Underlier>
<ContractGroup>Chemicals</ContractGroup>
<Currency>USD</Currency>
<ReferencePublication1>XYZ</ReferencePublication1>
<Underlying>ABC</Underlying>
<Underlying1>ABC</Underlying1>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-02-28</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-02-01</StartDate>
<Units>MT</Units>
<ClientPrice>472.84000000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-03-31</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-03-01</StartDate>
<Units>MT</Units>
<ClientPrice>456.46600000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-04-30</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-04-01</StartDate>
<Units>MT</Units>
<ClientPrice>440.30900000</ClientPrice>
</Instrument>
</Underlier>
</template123>
XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ab="http://www.markit.com/totem/api/data/V40">
<xsl:output method="text" />
<xsl:template match="ab:template123">
<xsl:text>ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate</xsl:text>
<xsl:text>
</xsl:text>
<xsl:value-of select="ab:ClientID" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ValuationDate" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:AssetClass" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceName" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceFrequency" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SubArea" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SchemaVersion" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/ab:ContractGroup" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/ab:Instrument/ab:EndDate" />
</xsl:template>
</xsl:stylesheet>
OUTPUT:
ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate
470|2019-01-31|Value|Oil|ME|10|40|Chemicals|2019-02-28
Look like two things are wrong in you scenario:
Default NameSpace in XML is exact match with transformation namespace
In match context you are on document node so either you need to use template123 in match or in <xsl:value-of select="template123/ClientID"/> & <xsl:value-of select="template123/AssetClass"/> you give the proper path to navigate the elements.
Below is the code you can use:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ClientID</th>
<th style="text-align:left">AssetClass</th>
</tr>
<tr>
<td><xsl:value-of select="template123/ClientID"/></td>
<td><xsl:value-of select="template123/AssetClass"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
You can see this link for your reference:
https://xsltfiddle.liberty-development.net/6rewNxZ/1

XSLT - dynamic node name

I want to convert all child node as attribute name to Nodes. and attribute value should be the node value.
How do i give dynamic node name?
<xsl:attribute name="shouldBeNodeName">
SOURCE XML
<transaction>
<transactionId>T001</transactionId>
<clientId>C001</clientId>
<contractId>C001</contractId>
<scriptId>REL</scriptId>
<price>500.5000</price>
<tradeDate>2019-02-09 16:00:00</tradeDate>
<valueDate>2019-02-09 16:00:00</valueDate>
<quantity>100000</quantity>
</transaction>
XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ROOT>
<TRANS>
<xsl:for-each select="node()/*">
<xsl:attribute name="shouldBeNodeName">
<!-- <xsl:value-of select="name()" /> -->
<xsl:value-of select="." />
</xsl:attribute>
</xsl:for-each>
</TRANS>
</ROOT>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ROOT>
<TRANS>
<xsl:for-each select="node()/*">
<xsl:attribute name="{name()}">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:for-each>
</TRANS>
</ROOT>
</xsl:template>

Compare two XML files with child nodes that are not in sequence using xmlunit 2.3.0

I want to compare two XML files in SoapUI (Groovy) which are similar but the child nodes are not in sequence. I'm using XML unit v2.3.0.
XML1:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
</env:Header>
<soap:Body>
<Details>
<RateType RateTypeID="6">
<RateType>AAAAA</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
<RateType RateTypeID="3">
<RateType>BBB</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
<RateType RateTypeID="41">
<RateType>CCC</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
<RateType RateTypeID="43">
<RateType>DDD</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
</Details>
</soap:Body>
</soap:Envelope>
XML2:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
</env:Header>
<soap:Body>
<Details>
<RateType RateTypeID="41">
<RateType>CCC</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
<RateType RateTypeID="43">
<RateType>DDD</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
<RateType RateTypeID="6">
<RateType>AAAAA</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
<RateType RateTypeID="3">
<RateType>BBB</RateType>
<BaseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
<UOM>percent</UOM>
</RateType>
</Details>
</soap:Body>
</soap:Envelope>
In the above example both the XML's are similar in content but only the sequence differs. I want to compare both of them to know if they are equal.
When I ran the below code:
Diff myDiffSimilar = DiffBuilder.compare(XML1))
.withTest(XML2)
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.conditionalBuilder().whenElementIsNamed("Rate").thenUse(ElementSelectors.selectorForElementNamed("RateValue", ElementSelectors.byNameAndAllAttributes)).build()))
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.conditionalBuilder().whenElementIsNamed("RateType").thenUse(ElementSelectors.selectorForElementNamed("RateType", ElementSelectors.byNameAndAllAttributes)).build()))
.checkForSimilar().build();
log.info myDiffSimilar.getDifferences().toString();
It gives me the following output
[Expected child '{http://schemas.xmlsoap.org/soap/envelope/}Envelope' but was 'null' - comparing <soap:Envelope...> at /Envelope[1] to <NULL> (DIFFERENT), Expected child 'null' but was '{http://schemas.xmlsoap.org/soap/envelope/}Envelope' - comparing <NULL> to <soap:Envelope...> at /Envelope[1] (DIFFERENT)]
Can someone advice me on the element selector/conditional builder that should be used in this scenario?
Try to use this :
Diff diff = DiffBuilder.compare(actual)
.withTest(expected)
.ignoreComments()
.ignoreWhitespace()
.checkForSimilar()
.withNodeMatcher(new DefaultNodeMatcher(new ByNameAndTextRecSelector(), ElementSelectors.byName))
.build();
assert diff.hasDifferences()==false

How to remove the specific attribute from XmlDocument

My Xml as below
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order>
<class>
<about></about>
</class>
<dataset>
<subjects>
<subject>
<addresses>
<address/>
</addresses>
</subject>
</subjects>
</dataset>
</order>
To reorder the xml element and to add namespace i did it as per below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order>
<class>
<about></about>
</class>
<dataset>
<subjects>
<subject>
</subject>
</subjects>
<addresses>
<address/>
</addresses>
</dataset>
</order>
I did using below code
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlClueReqToLexisNexis.NameTable);
nsmgr.AddNamespace("ab", "http://example.com/abc");
XmlNode order = xmlClueReqToLexisNexis.SelectSingleNode("//ab:order", nsmgr);
XmlNode dataset = xmlClueReqToLexisNexis.SelectSingleNode("//ab:order//ab:dataset", nsmgr);
var subjects = order.SelectSingleNode("//ab:order//ab:dataset//ab:subjects", nsmgr);
I am able to reorder and add namespace to it but it left behind xmlns attribute
as below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<order>
<class>
<about></about>
</class>
<dataset>
<subjects>
<subject xmlns="">
</subject>
</subjects>
<addresses xmlns="">
<address/>
</addresses>
</dataset>
</order>
I want to remove only attribute xmlns="" out of addresses and subject
Please suggest me the best way to do that.

apigee statistic collector/custom reports not working

I'm stuck at generating custom reports using Statistics Collector.
My scenario,
I have an BaaS DB with a collection named "icustomer" which has few name/value pair's.
I created a proxy(icustomer) to display an specific Customer(Resource name- specificcust) depending on unique "cust_id".
For Specific Customer I did "extract variable and assign variable policies" which is working fine.
Now to get custom reports I again added an Extract Variable policy to extract cust_id from JSON Path and then added and Statistic Collector policy to get stats.
Then I created an new report from Analytics and saved it. But reports aren't generated. All I get is "NO_ID" report.
Where did I go wrong?
Proxy Endpoint Code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<Description/>
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<Flows>
<Flow name="specficcust">
<Description/>
<Request/>
<Response/>
<Condition>(proxy.pathsuffix MatchesPath "/{cust_id}") and (request.verb = "GET")</Condition>
</Flow>
</Flows>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
<HTTPProxyConnection>
<BasePath>/icustomer</BasePath>
<VirtualHost>default</VirtualHost>
<VirtualHost>secure</VirtualHost>
</HTTPProxyConnection>
<RouteRule name="default">
<TargetEndpoint>default</TargetEndpoint>
</RouteRule>
</ProxyEndpoint>
Target Endpoint Code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<Description/>
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<Flows>
<Flow name="specficcust">
<Description/>
<Request>
<Step>
<FaultRules/>
<Name>Extract-Variables-1</Name>
</Step>
<Step>
<FaultRules/>
<Name>Assign-Message-1</Name>
</Step>
</Request>
<Condition>(proxy.pathsuffix MatchesPath "/{cust_id}") and (request.verb = "GET")</Condition>
<Response/>
</Flow>
</Flows>
<PostFlow name="PostFlow">
<Response>
<Step>
<FaultRules/>
<Name>Extracting-for-Stats</Name>
</Step>
<Step>
<FaultRules/>
<Name>Statistics-Collector-1</Name>
</Step>
</Response>
<Request/>
</PostFlow>
<HTTPTargetConnection>
<URL>https://api.usergrid.com/siddharth1/sandbox/icustomer</URL>
</HTTPTargetConnection>
</TargetEndpoint>
Extracting for Stats code-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="Extracting-for-Stats">
<DisplayName>Extracting for Stats</DisplayName>
<FaultRules/>
<Properties/>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<JSONPayload>
<Variable name="customer_id">
<JSONPath>$.entities[0].cust_id</JSONPath>
</Variable>
</JSONPayload>
<Source clearPayload="false">response</Source>
<VariablePrefix>apigee</VariablePrefix>
</ExtractVariables>
Statistics Collector code-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StatisticsCollector async="false" continueOnError="false" enabled="true" name="Statistics-Collector-1">
<DisplayName>Statistics Collector 1</DisplayName>
<FaultRules/>
<Properties/>
<Statistics>
<Statistic name="test_cust_id" ref="customer_id" type="STRING">NO_ID</Statistic>
</Statistics>
</StatisticsCollector>
Your ExtractVariables specifies a VariablePrefix of "apigee". I would expect the extracted field to be accessible from apigee.customer_id instead of just customer_id, which would return null in the StatisticsCollector check. I think that's why you are getting your default "NO_ID".

Resources