When using XPath or XQuery, is there a way to limit the depth of the result?
I am using BaseX, which supports XQuery 3.1 and XSLT 2.0.
For example, given this input document:
<country name="United States">
<state name="California">
<county name="Alameda" >
<city name="Alameda" />
<city name="Oakland" />
<city name="Piedmont" />
</county>
<county name="Los Angeles">
<city name="Los Angeles" />
<city name="Malibu" />
<city name="Burbank" />
</county>
<county name="Marin">
<city name="Fairfax" />
<city name="Larkspur" />
<city name="Ross" />
</county>
<county name="Sacramento">
<city name="Folsom" />
<city name="Elk Grove" />
<city name="Sacramento" />
</county>
</state>
</country>
If I execute this query: /country/state, I get the following result:
<state name="California">
<county name="Alameda">
<city name="Alameda"/>
<city name="Oakland"/>
<city name="Piedmont"/>
</county>
<county name="Los Angeles">
<city name="Los Angeles"/>
<city name="Malibu"/>
<city name="Burbank"/>
</county>
<county name="Marin">
<city name="Fairfax"/>
<city name="Larkspur"/>
<city name="Ross"/>
</county>
<county name="Sacramento">
<city name="Folsom"/>
<city name="Elk Grove"/>
<city name="Sacramento"/>
</county>
</state>
I would like to limit the depth of the result. Ideally, there'd be a way for me to specify the depth, rather than hard-coding an XPath query.
As an example, I would like to limit the result to the result nodes and its children, but not including the grandchildren, so the result would be:
<state name="California">
<county name="Alameda" />
<county name="Los Angeles" />
<county name="Marin" />
<county name="Sacramento" />
</state>
One easy and straightforward way is to use XSLT-2.0 with an empty template cancelling all children of <county>. The <xsl:strip-space> removes the space that would have been used by the children.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:strip-space elements="*" />
<!-- Identity template -->
<xsl:template match="#* | node()">
<xsl:copy>
<xsl:apply-templates select="#* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="/country/state" />
</xsl:template>
<xsl:template match="county/*" />
</xsl:stylesheet>
Output is:
<?xml version="1.0" encoding="UTF-8"?>
<state name="California">
<county name="Alameda"/>
<county name="Los Angeles"/>
<county name="Marin"/>
<county name="Sacramento"/>
</state>
With XQuery, a solution could look like this:
for $st in doc("b.xml")/country/state return
element { node-name($st) } { $st/#*,
for $ct in $st/county return
element { node-name($ct) } { $ct/#* }
}
The output is the same.
Actually the result of your query is a single node, the state node in the source document. Some software is then displaying the results of the query - that is, the state node - in some particular format, but in principle the results could be displayed in a different way without changing the query. For example, I'm aware of software that would display the results of this query as
/country[1]/state[1]
So you need to separate two questions: what nodes does the query return, and how are they displayed? In some cases it might make sense to create a processing pipeline where the first step selects the nodes of interest, and the second step controls the presentation of the results.
Personally I would always do the second step in XSLT, but some people prefer XQuery. Take your pick.
#zx845's post got me on the right track. My ultimate goal was to limit the depth of the result, with the intent of getting a "summary" and the metadata I need to get deeper results if necessary.
BaseX has a function "db:node-id" which will return the internal node ID of any given node. There's another function, "db:open-id" which returns the node with a given ID.
Suppose this given input:
<country name="United States">
<state name="California">
<county name="Alameda">
<city name="Alameda"/>
<city name="Oakland"/>
<city name="Piedmont"/>
</county>
<county name="Los Angeles">
<city name="Los Angeles"/>
<city name="Malibu"/>
<city name="Burbank"/>
</county>
<county name="Marin">
<city name="Fairfax"/>
<city name="Larkspur"/>
<city name="Ross"/>
</county>
<county name="Sacramento">
<city name="Folsom"/>
<city name="Elk Grove"/>
<city name="Sacramento"/>
</county>
</state>
<state name="New York">
<county name="Albany">
<city name="Albany"/>
<city name="Cohoes"/>
<city name="Watervliet"/>
</county>
<county name="Erie">
<city name="Buffalo"/>
<city name="Lackawanna"/>
<city name="Tonawanda"/>
</county>
</state>
</country>
I defined this function, which lets me control the depth, and return the node-id for each node.
declare function local:abbreviated($input, $depth as xs:integer)
{
if($depth = 0) then
element node {
db:node-id($input)
}
else
element { node-name($input) } {
attribute node-id {
db:node-id($input)
},
$input/#*,
$input/text(),
for $child in $input/*
return local:abbreviated($child, $depth - 1)
}
};
If I execute the following:
declare variable $input := /country/state;
for $result in $input
return local:abbreviated($result, 1)
Then I get this result:
<state node-id="3" name="California">
<node>5</node>
<node>13</node>
<node>21</node>
<node>29</node>
</state>
<state node-id="37" name="New York">
<node>39</node>
<node>47</node>
</state>
Now, when I process the results, if the user wants more details for a state element, I can process each 'node' element and execute this query to get the actual contents of the node
local:abbreviated(db:open-id('states', 5), 2)
Resulting in:
<county node-id="5" name="Alameda">
<city node-id="7" name="Alameda"/>
<city node-id="9" name="Oakland"/>
<city node-id="11" name="Piedmont"/>
</county>
Related
is there a way to define a slicing based on the value of an extension on top of each element of a collection? example: Procedure.bodySite
<element id="Procedure.bodySite">
<path value="Procedure.bodySite" />
<slicing>
<discriminator>
<type value="value" />
<path value="bodySite.extension("http://a/ext").value" />
</discriminator>
<rules value="open" />
</slicing>
</element>
<element id="Procedure.bodySite.extension">
<path value="Procedure.bodySite.extension" />
<slicing>
<discriminator>
<type value="value" />
<path value="url" />
</discriminator>
<rules value="open" />
</slicing>
</element>
<element id="Procedure.bodySite.extension:myExtension">
<path value="Procedure.bodySite.extension" />
<sliceName value="myExtension" />
<type>
<code value="Extension" />
<profile value="http://a/ext" />
</type>
</element>
<element id="Procedure.bodySite:sliceBodySite">
<path value="Procedure.bodySite" />
<sliceName value="sliceBodySite" />
<max value="1" />
</element>
<element id="Procedure.bodySite:sliceBodySite.text">
<path value="Procedure.bodySite.extension" />
<fixedBoolean value="true" />
</element>
the result is : Unable to resolve discriminator in definitions: bodySite.extension('http://a/ext').value
so what is the problem here?
You can use .extension("url") as part of the path in a discriminator. So you can slice by value with a discriminator path of:
bodySite.extension("http://your/extension/url/here").value
I need to delete all the line items <LineItem> from the file which does not suffice with this requirements:
elements in Line Item : <LineItemNumber V="00000000000000000010" /> and <PurchaseOrderNumber V="0100230946|00010" /> have to be matched, another words in integer Line Item Number would be 10 and Purchase order number after pipe line | would be 10. we need to have only one those line Items which are matching this requirement. Sorry, i'm really bad at describing.
<Transmission>
<InterchangeUsageIndicator V="T" />
<Groups>
<Group>
<GroupSenderID V="CCC" />
<TotalNumberOfShipmentsInGroup V="000005" />
<Documents>
<Document>
<DocumentHeader>
<InvoiceChargeType V="T" />
<DocumentType V="ORDER" />
<DocumentProcessingCode C="00" />
<BOLNumber V="BOL2309460180582136" />
<AlternateQuantities>
<AlternateQuantity Quantity="12.0" UOM="PK" UOMType="SQ" Characteristic="" />
</AlternateQuantities>
<Buyer Name="" Q="ZP" ID="COUSPO001">
<AlternateIDs />
</Buyer>
<Seller Name="" Q="2" ID="CNTR">
<AlternateIDs />
</Seller>
<Parties>
<Party PartyType="SF">
<Name V="SHA" />
<LocationID Q="" ID="" />
<AlternateLocationIDs>
<LocationID Q="" ID="SHA" />
</AlternateLocationIDs>
<City V="Shanghai" />
<Country V="CN" />
<LocationPurpose V="" />
</Party>
<Party PartyType="ST">
<Name V="LEB" />
<LocationID Q="" ID="" />
<AlternateLocationIDs>
<LocationID Q="" ID="LEB" />
</AlternateLocationIDs>
<City V="Lebanon" />
<Country V="TN" />
<LocationPurpose V="" />
</Party>
<Party PartyType="VN">
<Name V="YANGZHOU BAOYI SHOES" />
<LocationID Q="" ID="4100000423" />
<AlternateLocationIDs />
<City V="JIANGSU" />
<Country V="CN" />
<LocationPurpose V="" />
</Party>
</Parties>
<DateReferences>
<DR Type="D" Q="ETA" Date="2019-12-19" />
<DR Type="D" Q="EST" Date="2019-11-28" />
</DateReferences>
<ReservedReferences>
<RR Type="R" Q="K6" V="86|SEAL230946" />
<RR Type="R" Q="V3" V="VYG230946|BKG230946" />
</ReservedReferences>
</DocumentHeader>
<Vessel VesselName="VSL230946" VesselNumber="" VesselCountryOfRegistration="" VesselRegistrationNumber="" />
<Equipments>
<Equipment Initial="CNTR" Number="230946" Length="0" Type="" TotalContainerVolume="52.06" />
</Equipments>
<LineItems>
<LineItem>
<LineItemNumber V="00000000000000000010" />
<LineItemType C="LI" />
<TransportationServiceCode Code="" />
<PurchaseOrderNumber V="0100230946|00010" />
<AdditionalReferenceNumber V="" />
<DescriptionMarksAndNumbers>
<CommodityCode Q="" C="M9160" />
<BuyerProductID V="" />
</DescriptionMarksAndNumbers>
<BilledRatedAsQuantity V="0.0" UOM="PA" />
<LadingQuantity V="0.0" UOM="PA" />
<LineItemTotalAmount V="0.0" />
<LineItemWeight V="0.00" />
<LineItemVolume V="0.00" />
</LineItem>
<LineItem>
<LineItemNumber V="00000000000000900001" /> //this one would not work,because it is 900001
<LineItemType C="LI" />
<LineItemSubType C="SCH" />
<TransportationServiceCode Code="" />
<PurchaseOrderNumber V="0100230946|00010" />
<AdditionalReferenceNumber V="" />
<DescriptionMarksAndNumbers>
<CommodityCode Q="" C="M9160" />
<BuyerProductID V="" />
</DescriptionMarksAndNumbers>
<BilledRatedAsQuantity V="24.0" UOM="PA" />
<LadingQuantity V="24.0" UOM="PA" />
<LineItemTotalAmount V="0.0" />
<UserDefinedReferences>
<UDR Type="U" Q="CR" V="22859470896|001|0001" Description="" />
<UDR Type="U" Q="S6" V="|3|20" Description="" />
<UDR Type="U" Q="19" V="M9160|USDS|0001" Description="" />
</UserDefinedReferences>
<LineItemWeight V="2959.54" />
<LineItemVolume V="104.12" />
</LineItem>
<LineItem>
<LineItemNumber V="00000000000000900002" />
<LineItemType C="LI" />
<LineItemSubType C="SCH" />
<TransportationServiceCode Code="" />
<PurchaseOrderNumber V="0100230946|00010" />
<AdditionalReferenceNumber V="" />
<DescriptionMarksAndNumbers>
<CommodityCode Q="" C="M9160" />
<BuyerProductID V="" />
</DescriptionMarksAndNumbers>
<BilledRatedAsQuantity V="24.0" UOM="PA" />
<LadingQuantity V="24.0" UOM="PA" />
<LineItemTotalAmount V="0.0" />
<UserDefinedReferences>
<UDR Type="U" Q="CR" V="22859470902|001|0002" Description="" />
<UDR Type="U" Q="S6" V="|3.5|20" Description="" />
<UDR Type="U" Q="19" V="M9160|USDS|0001" Description="" />
</UserDefinedReferences>
<LineItemWeight V="2959.54" />
<LineItemVolume V="104.12" />
</LineItem>
I tried to start on LINQ: this is where I got so far:
try {
var xDoc = XDocument.Parse(msg.Body);
var xDocument = xDoc.Root.XPathSelectElement("Groups/Group/Documents/Document");
var xLineItems = xDocument.XPathSelectElements("LineItems/LineItem");
var poNumbers = xLineItems.Select(e => (string)e.Element("PurchaseOrderNumber").Attribute("V")).Distinct();
foreach (var poNumber in poNumbers) {
}
msg.Body = xDoc.ToString();
I believe you would like to Delete all LineItem where LineItemNumber!=10 and PurchaseOrderNumber after the Pipe NOT equals 10. You could use Linq to filter the elements that match the purpose and use the Remove method to deletes the selected nodes.
var xDoc = XDocument.Parse(xml);
xDoc.Descendants("LineItem")
.Where(x=> Convert.ToInt32(x.Element("LineItemNumber").Attribute("V").Value)!=10
&& Convert.ToInt32(x.Element("PurchaseOrderNumber").Attribute("V").Value.Split('|')[1])!=10
).Remove();
var result = xDoc.ToString();
I have the following request:
<request>
<sender>A</sender>
<id>01</id>
<parameters>
<parameter value="1" />
<parameter value="2" />
</parameters>
</request>
I want to send the response:
<response>
<id>01</id>
<parameters>
<parameter value="1" />
<parameter value="2" />
</parameters>
<result>3</result>
</response>
So most of the response is the same : the id, the parameters. Is there a way to get a subset of xml full text with an xpath expression?
I would like to get :
<id>01</id>
<parameters>
<parameter value="1" />
<parameter value="2" />
</parameters>
Optional question: is it possible to get only one string ?
Basically I want the result of my XPath evaluation to be :
"<id>01</id>
<parameters>
<parameter value="1" />
<parameter value="2" />
</parameters>"
Thanks!
XPath can't create new nodes, or modify existing nodes: it can only select nodes that are already present in your input. You need XQuery or XSLT. It's simple enough (XSLT 2.0):
<xsl:template match="request">
<response>
<xsl:copy-of select="id, parameters"/>
<result>3</result>
</response>
</xsl:template>
I want to import a ".webtest" in Azure's Application Insights availability feature. I dont have a test edition of Visual Studio, but this MSDN article suggests using Fiddler as another option to creating web tests.
I need to perform 2 requests on a REST API:
Request a bearer token from the connect/token endpoint.
Perform a GET at api/resources with the bearer token (retrieved from the above request) in the header.
It's a typical client credentials OAuth 2 flow.
I cannot seem to figure out how to do this with Fiddler. Basically I need to extract a value from the response body of request 1 and use it as the header value in request 2.
This is what the web test looks like without passing the token:
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
Assuming this comes back as the following example you can use a regex extraction to get it.
{"token_type":"Bearer","scope":"user_impersonation","expires_in":"3600 ... "access_token":"{{TOKEN}}", ...}
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://example.com/connect/token" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<Headers>
<Header Name="Content-Type" Value="application/x-www-form-urlencoded" />
</Headers>
<FormPostHttpBody ContentType="application/x-www-form-urlencoded">
<FormPostParameter Name="client_id" Value="myclientid" UrlEncode="True" />
<FormPostParameter Name="client_secret" Value="password123" UrlEncode="True" />
<FormPostParameter Name="grant_type" Value="client_credentials" UrlEncode="True" />
<FormPostParameter Name="scope" Value="myscopes" UrlEncode="True" />
</FormPostHttpBody>
</Request>
<Request Method="GET" Version="1.1" Url="https://example.com/api/resources" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</TestCase>
To compliment James Davis's answer, if you need to login to https://yourapp.com/auth/login by posting the JSON:
{
user: 'youruser',
password: 'yourpassword'
}
first base64 encode the json:
> echo "{user: 'youruser', password: 'yourpassword'}" | base64
e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K
Then pass this base64 value in a StringHttpBody tag
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="login-healthcheck" Id="e91b6e1d-3fa0-475f-a18b-b694b463589c" Owner="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="POST" Guid="ef9d1d00-5663-476a-a3cb-ccf49c4d2229" Version="1.1" Url="https://yourapp.com/auth/login" ThinkTime="8" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Content-Type" Value="application/json" />
</Headers>
<ExtractionRules>
<ExtractionRule Classname="Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractRegularExpression, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" VariableName="token" DisplayName="Extract Regular Expression" Description="Extract text from the response matching a regular expression and place it into the test context.">
<RuleParameters>
<RuleParameter Name="RegularExpression" Value=".*"access_token":"([^"]*)".*" />
<RuleParameter Name="IgnoreCase" Value="True" />
<RuleParameter Name="Required" Value="True" />
<RuleParameter Name="Index" Value="0" />
<RuleParameter Name="HtmlDecode" Value="True" />
<RuleParameter Name="UseGroups" Value="True" />
</RuleParameters>
</ExtractionRule>
</ExtractionRules>
<StringHttpBody ContentType="application/json" InsertByteOrderMark="False">e3VzZXI6ICd5b3VydXNlcicsIHBhc3N3b3JkOiAneW91cnBhc3N3b3JkJ30K</StringHttpBody>
</Request>
<Request Method="GET" Guid="d566422f-af74-47bf-90aa-0c66db6ef567" Version="1.1" Url="https://yourapp.com/api/v1/healthcheck" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False">
<Headers>
<Header Name="Authorization" Value="Bearer {{token}}" />
</Headers>
</Request>
</Items>
</WebTest>
Worked for me on Azure Application Insights Availability checking
I am trying to show a trend of processes that run every day over time. Therefore I have a date which I call processing date, which I want to be shown on the X-Axis, and an end_time (date timestamp) since the end time can finish before or after midnight. Therefore I would like to be able to plot the data on the Y axis. I am using Oracle APEX v5, not sure which version of Anychart is running behind, maybe this is version related?
So far, I have not figured out a way for the values returned by my query to be plotted correctly when the values are dates. Is this possible? These are the settings of the y_axis, which when used do not show any data on the graph.
<y_axis >
<scale type="DateTime" mode="Normal" />
<title enabled="false" />
<labels enabled="true" position="Outside">
<font family="Tahoma" size="10" color="0x000000" />
<format>
<![CDATA[{%Value}]]>
</format>
</labels>
<major_grid enabled="False"/>
<minor_grid enabled="False"/>
</y_axis>
When I convert the dates to a number, they are plotted correctly, but so far I had no luck with trying to convert them back to a date using the settings/locale:
<settings>
<locale>
<date_time_format>
<format>%yyyy%MM%dd%HH%mm%ss</format>
</date_time_format>
</locale>
<animation enabled="false"/>
<no_data show_waiting_animation="False">
<label>
<text>#NO_DATA_MESSAGE#</text>
<font family="Verdana" bold="yes" size="10"/>
</label>
</no_data>
</settings>
I am using this to generate the test points with values:
select null as link, trunc (sysdate) as label, to_char((sysdate),'YYYYMMDDHH24MISS') as end_time from dual
union
select null as link, trunc (sysdate)-1 as label, to_char((sysdate)-1,'YYYYMMDDHH24MISS') as end_time from dual
order by label;
The Value of the point ends up being "2016%MM20%HH00%ss", I tried changing the upper/lower case of the formatting to no avail. From the output it looks like the %vars cannot be used concatenated, but if that is the case, then I cannot use values to convert the dates...
Maybe this is conceptually wrong, but so far I have not found a way to plot these correctly. I hope someone can shed some light on this.
Thank you in advance.
Edit:
I managed to do it ignoring the XML from Apex and creating my own datapoints (I will post the complete answer later), this is a sample of the XML:
<?xml version = "1.0" encoding="utf-8" standalone = "yes"?>
<anychart>
<settings>
<animation enabled="false" />
<no_data show_waiting_animation="False">
<label>
<text>No data found</text>
<font family="Verdana" bold="yes" size="10" />
</label>
</no_data>
<locale>
<date_time_format>
<format>
<![CDATA[%dd-%MM-%yyyy %HH:%mm]]>
</format>
</date_time_format>
</locale>
</settings>
<margin left="0" top="0" right="0" bottom="0" />
<charts>
<chart plot_type="CategorizedVertical" name="chart_52322125829114359521">
<chart_settings>
<title enabled="False" />
<chart_background>
<fill type="Solid" color="0xffffff" opacity="0" />
<border enabled="false" />
<corners type="Square" />
</chart_background>
<data_plot_background></data_plot_background>
<axes>
<y_axis>
<scale type="DateTime" mode="Normal" />
<title enabled="false" />
<labels enabled="true" position="Outside">
<font family="Tahoma" size="10" color="0x000000" />
<format>
<![CDATA[{%Value}{dateTimeFormat:%HH:%mm}]]>
</format>
</labels>
<major_grid enabled="True" interlaced="false">
<line color="Black" />
</major_grid>
<minor_grid enabled="True"></minor_grid>
</y_axis>
<x_axis>
<scale type="DateTime" mode="Normal" />
<title enabled="false" />
<labels enabled="true" position="Outside">
<font family="Tahoma" size="10" color="0x000000" />
<format>
<![CDATA[{%Value}{dateTimeFormat:%ddd %dd-%MM-%yyyy}]]>
</format>
</labels>
<major_grid enabled="True" interlaced="false">
<line color="Black" />
</major_grid>
<minor_grid enabled="True"></minor_grid>
</x_axis>
</axes>
<legend enabled="true" position="Right" align="Near" elements_layout="Vertical">
<title enabled="False"/>
<icon>
<marker enabled="true" />
</icon>
<font family="Tahoma" size="10" color="0x000000" />
</legend>
</chart_settings>
<data_plot_settings enable_3d_mode="false" default_series_type="Line">
<line_series>
<tooltip_settings enabled="true">
<format>
<![CDATA[{%SeriesName} {%Name} {%Value}{dateTimeFormat:%HH:%mm}]]>
</format>
<font family="Tahoma" size="10" color="0x000000" />
<position anchor="Center" valign="Top" halign="Center" padding="10" />
</tooltip_settings>
<label_settings enabled='&LABEL.' mode="Outside" multi_line_align="Center">
<format>
<![CDATA[{%Value}{dateTimeFormat:%HH:%mm}]]>
</format>
<background enabled="false" />
<font family="Tahoma" size="10" color="0x000000" />
</label_settings>
<line_style>
<line enabled="true" thickness="2" opacity="1" />
</line_style>
<marker_settings enabled="True" >
<marker type="HLine" />
</marker_settings>
</line_series>
</data_plot_settings>
<data>
<series name="AEG" type="Line">
<point name="01-03-2016 00:00" y="01-01-2001 23:35"></point>
<point name="02-03-2016 00:00" y="01-01-2001 23:16"></point>
<point name="03-03-2016 00:00" y="01-01-2001 23:20"></point>
<point name="04-03-2016 00:00" y="01-01-2001 23:32"></point>
<point name="07-03-2016 00:00" y="01-01-2001 23:28"></point>
<point name="08-03-2016 00:00" y="01-01-2001 23:24"></point>
<point name="09-03-2016 00:00" y="01-01-2001 23:14"></point>
<point name="10-03-2016 00:00" y="01-01-2001 23:30"></point>
<point name="11-03-2016 00:00" y="01-01-2001 23:54"></point>
<point name="14-03-2016 00:00" y="01-01-2001 23:52"></point>
<point name="15-03-2016 00:00" y="01-01-2001 23:27"></point>
<point name="16-03-2016 00:00" y="01-01-2001 23:51"></point>
<point name="17-03-2016 00:00" y="01-01-2001 23:34"></point>
<point name="18-03-2016 00:00" y="01-01-2001 23:32"></point>
<point name="21-03-2016 00:00" y="02-01-2001 00:02"></point>
</series>
</data>
</chart>
</charts>
</anychart>
A new question is, can you help me understand why the tooltip does not get the correct value on the %Name?
<![CDATA[{%SeriesName} {%Name} {%Value}{dateTimeFormat:%HH:%mm}]]>
In the tooltip I am getting the following text on the first point is AEG 01-01-1970 00:00 23:35 and I was expecting, based on the name 01-03-2016 00:00 23:35
Thanks!