Using XMLNamespaces in SQL Query - sql

This is a file received from customer.
I tried everything to go over the namespace in the file.
Always getting Null value. If I remove everything after Report in the header, it works fine.
I tried WITH XMLNamespaces in many different ways without success.
Please help me having this script working:
DECLARE #data XML;
SET #data =
'<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Support_x0020_Contract_x0020_Estimate" xsi:schemaLocation="Support_x0020_Contract_x0020_Estimate http://iomlkfsqlp08.corp.com/ReportServer?%2FIT%20Operations%2FSupport%20Contract%20Estimate&rs%3ACommand=Render&rs%3AFormat=XML&rs%3ASessionID=t3f0mu45i0embcmvkcoardad&rc%3ASchema=True" Name="Support Contract Estimate">
<table3 textbox44="249161.2050" textbox64="249161.20500000">
<table3_Group1_Collection>
<table3_Group1 textbox38="Q.I.T. - Fer et Titane Inc. - Customer Site ID: 16849
1625 Marie-Victorin
Tracy, Quebec J3R 1M6
CANADA
(450) 746-3000
CF Agreement#: 32466
Percentage Support - Standard Support Level
Start Date: 17-Jan-2021 - End Date: 16-Jan-2022
">
<Detail_Collection>
<Detail textbox42="Q.I.T. - Fer et Titane Inc. - Customer Site ID: 16849
1625 Marie-Victorin
Tracy, Quebec J3R 1M6
CANADA
(450) 746-3000
CF Agreement#: 32466
Percentage Support - Standard Support Level
Start Date: 17-Jan-2021 - End Date: 16-Jan-2022
" />
<Detail textbox42="CF Agreement Net Price" textbox46="245523.4050" textbox63="245523.40500000" />
</Detail_Collection>
</table3_Group1>
</table3_Group1_Collection>
</table3>
<table5>
<table4_Group3_Collection>
<table4_Group3 pricingresult1="Q.I.T. - Fer et Titane Inc. - Customer Site ID: 16849
1625 Marie-Victorin
Tracy, Quebec J3R 1M6
CANADA
(450) 746-3000
CF Agreement#: 32466
Percentage Support - Standard Support Level
Start Date: 17-Jan-2021 - End Date: 16-Jan-2022
" Textbox11="1 USD:
1.0000 USD" textbox72="2403700.0000" Textbox135="245523.4050" Textbox18="245523.40500000">
<table4_Group4_Collection>
<table4_Group4 textbox68="CF-STANDRD-R-HST" textbox69="772685.0000" pricingmethodtiermultiplier="0.17" Textbox104="131356.45" renewalvolumediscount="0.399999999999999" Textbox112="78813.8700000001" Textbox17="78813.8700000001" />
<table4_Group4 textbox68="CF-STANDRD-R-MES" textbox69="10485.0000" pricingmethodtiermultiplier="0.225" Textbox104="2359.125" renewalvolumediscount="0.4" Textbox112="1415.475" Textbox17="1415.475" />
<table4_Group4 textbox68="CF-STANDRD-R-WW" textbox69="1620530.0000" pricingmethodtiermultiplier="0.170000000000001" Textbox104="275490.100000002" renewalvolumediscount="0.400000000000004" Textbox112="165294.06" Textbox17="165294.06" />
</table4_Group4_Collection>
<table4>
<table4_Group2_Collection>
<table4_Group2>
<table4_Group1_Collection>
<table4_Group1>
<Detail_Collection>
<Detail textbox15="Renewal Volume Discount (40.00%)" textbox16="-163682.2700" Textbox61="-163682.27000000" />
</Detail_Collection>
</table4_Group1>
<table4_Group1>
<Detail_Collection>
<Detail textbox15="CF Agreement Net Price" textbox16="245523.4050" Textbox61="245523.40500000" />
</Detail_Collection>
</table4_Group1>
<table4_Group1>
<Detail_Collection>
<Detail textbox15="Cost to upgrade to Premium ($43,235.15)" textbox16="288758.5500" Textbox61="288758.55000000" />
<Detail textbox15="Cost to upgrade to Elite ($86,501.75)" textbox16="332025.1500" Textbox61="332025.15000000" />
</Detail_Collection>
</table4_Group1>
</table4_Group1_Collection>
</table4_Group2>
</table4_Group2_Collection>
</table4>
<table6 Textbox9="3RD PARTY PRODUCT FOR CUSTOMER SITE ID: 16849">
<table4_Group5_Collection>
<table4_Group5 Textbox12="1 USD:
1.0000 USD" textbox76="20210.0000" Textbox116="3637.8000" Textbox20="3637.80000000">
<table4_Group6_Collection>
<table4_Group6 textbox73="10-7008R" textbox74="20210.0000" pricingmethodtiermultiplier2="0.18" Textbox107="3637.8" renewalvolumediscount2="0" Textbox115="3637.8" Textbox19="3637.8" />
</table4_Group6_Collection>
</table4_Group5>
</table4_Group5_Collection>
</table6>
</table4_Group3>
</table4_Group3_Collection>
</table5>
<table2 />
<table1>
<table1_Group1_Collection>
<table1_Group1 textbox7="PRICING DETAIL BY LICENSE FOR CUSTOMER SITE ID: 16849 - CFA#: 32466" textbox3="1 USD:
1.0000 USD" listprice_csequiv_1="2423910.0000" textbox4="2423910.00000000">
<Detail_Collection>
<Detail sw_ser_no="408997-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.6" pricingvalue="6490.00000000" />
<Detail sw_ser_no="408998-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.66" pricingvalue="6490.00000000" />
<Detail sw_ser_no="408999-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.72" pricingvalue="6490.00000000" />
<Detail sw_ser_no="409000-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.783" pricingvalue="6490.00000000" />
<Detail sw_ser_no="416268-14" sw_sell_part_no="InTDev-01-C-20" sw_part_desc="UpgC, Dev Studio 2020 Limited InTouch Dev/RT 64Tag" numofconcurusers="1" listprice_csequiv="940.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-07-30T07:31:46.553" pricingvalue="940.00000000" />
</Detail_Collection>
</table1_Group1>
</table1_Group1_Collection>
</table1>
</Report>';
---WITH XMLNAMESPACES (DEFAULT'xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance')
SELECT #data.value('(Report/table1/table1_Group1_Collection/table1_Group1/Detail_Collection/Detail/#sw_ser_no)[1]', 'nvarchar(50)') as sw_ser_no

Your default namespace is 'Support_x0020_Contract_x0020_Estimate'
DECLARE #data XML;
SET #data =
'<Report xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Support_x0020_Contract_x0020_Estimate" xsi:schemaLocation="Support_x0020_Contract_x0020_Estimate http://iomlkfsqlp08.corp.com/ReportServer?%2FIT%20Operations%2FSupport%20Contract%20Estimate&rs%3ACommand=Render&rs%3AFormat=XML&rs%3ASessionID=t3f0mu45i0embcmvkcoardad&rc%3ASchema=True" Name="Support Contract Estimate">
<table3 textbox44="249161.2050" textbox64="249161.20500000">
<table3_Group1_Collection>
<table3_Group1 textbox38="Q.I.T. - Fer et Titane Inc. - Customer Site ID: 16849
1625 Marie-Victorin
Tracy, Quebec J3R 1M6
CANADA
(450) 746-3000
CF Agreement#: 32466
Percentage Support - Standard Support Level
Start Date: 17-Jan-2021 - End Date: 16-Jan-2022
">
<Detail_Collection>
<Detail textbox42="Q.I.T. - Fer et Titane Inc. - Customer Site ID: 16849
1625 Marie-Victorin
Tracy, Quebec J3R 1M6
CANADA
(450) 746-3000
CF Agreement#: 32466
Percentage Support - Standard Support Level
Start Date: 17-Jan-2021 - End Date: 16-Jan-2022
" />
<Detail textbox42="CF Agreement Net Price" textbox46="245523.4050" textbox63="245523.40500000" />
</Detail_Collection>
</table3_Group1>
</table3_Group1_Collection>
</table3>
<table5>
<table4_Group3_Collection>
<table4_Group3 pricingresult1="Q.I.T. - Fer et Titane Inc. - Customer Site ID: 16849
1625 Marie-Victorin
Tracy, Quebec J3R 1M6
CANADA
(450) 746-3000
CF Agreement#: 32466
Percentage Support - Standard Support Level
Start Date: 17-Jan-2021 - End Date: 16-Jan-2022
" Textbox11="1 USD:
1.0000 USD" textbox72="2403700.0000" Textbox135="245523.4050" Textbox18="245523.40500000">
<table4_Group4_Collection>
<table4_Group4 textbox68="CF-STANDRD-R-HST" textbox69="772685.0000" pricingmethodtiermultiplier="0.17" Textbox104="131356.45" renewalvolumediscount="0.399999999999999" Textbox112="78813.8700000001" Textbox17="78813.8700000001" />
<table4_Group4 textbox68="CF-STANDRD-R-MES" textbox69="10485.0000" pricingmethodtiermultiplier="0.225" Textbox104="2359.125" renewalvolumediscount="0.4" Textbox112="1415.475" Textbox17="1415.475" />
<table4_Group4 textbox68="CF-STANDRD-R-WW" textbox69="1620530.0000" pricingmethodtiermultiplier="0.170000000000001" Textbox104="275490.100000002" renewalvolumediscount="0.400000000000004" Textbox112="165294.06" Textbox17="165294.06" />
</table4_Group4_Collection>
<table4>
<table4_Group2_Collection>
<table4_Group2>
<table4_Group1_Collection>
<table4_Group1>
<Detail_Collection>
<Detail textbox15="Renewal Volume Discount (40.00%)" textbox16="-163682.2700" Textbox61="-163682.27000000" />
</Detail_Collection>
</table4_Group1>
<table4_Group1>
<Detail_Collection>
<Detail textbox15="CF Agreement Net Price" textbox16="245523.4050" Textbox61="245523.40500000" />
</Detail_Collection>
</table4_Group1>
<table4_Group1>
<Detail_Collection>
<Detail textbox15="Cost to upgrade to Premium ($43,235.15)" textbox16="288758.5500" Textbox61="288758.55000000" />
<Detail textbox15="Cost to upgrade to Elite ($86,501.75)" textbox16="332025.1500" Textbox61="332025.15000000" />
</Detail_Collection>
</table4_Group1>
</table4_Group1_Collection>
</table4_Group2>
</table4_Group2_Collection>
</table4>
<table6 Textbox9="3RD PARTY PRODUCT FOR CUSTOMER SITE ID: 16849">
<table4_Group5_Collection>
<table4_Group5 Textbox12="1 USD:
1.0000 USD" textbox76="20210.0000" Textbox116="3637.8000" Textbox20="3637.80000000">
<table4_Group6_Collection>
<table4_Group6 textbox73="10-7008R" textbox74="20210.0000" pricingmethodtiermultiplier2="0.18" Textbox107="3637.8" renewalvolumediscount2="0" Textbox115="3637.8" Textbox19="3637.8" />
</table4_Group6_Collection>
</table4_Group5>
</table4_Group5_Collection>
</table6>
</table4_Group3>
</table4_Group3_Collection>
</table5>
<table2 />
<table1>
<table1_Group1_Collection>
<table1_Group1 textbox7="PRICING DETAIL BY LICENSE FOR CUSTOMER SITE ID: 16849 - CFA#: 32466" textbox3="1 USD:
1.0000 USD" listprice_csequiv_1="2423910.0000" textbox4="2423910.00000000">
<Detail_Collection>
<Detail sw_ser_no="408997-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.6" pricingvalue="6490.00000000" />
<Detail sw_ser_no="408998-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.66" pricingvalue="6490.00000000" />
<Detail sw_ser_no="408999-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.72" pricingvalue="6490.00000000" />
<Detail sw_ser_no="409000-13" sw_sell_part_no="InTch-06-C-20" sw_part_desc="UpgC, InTouch HMI 2020 Wrkst 60000 Tag with I/O" numofconcurusers="1" listprice_csequiv="6490.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-11-25T07:45:26.783" pricingvalue="6490.00000000" />
<Detail sw_ser_no="416268-14" sw_sell_part_no="InTDev-01-C-20" sw_part_desc="UpgC, Dev Studio 2020 Limited InTouch Dev/RT 64Tag" numofconcurusers="1" listprice_csequiv="940.0000" pricingmethodid2="WW HMI SCADA" intropricingflag="No" create_date="2020-07-30T07:31:46.553" pricingvalue="940.00000000" />
</Detail_Collection>
</table1_Group1>
</table1_Group1_Collection>
</table1>
</Report>';
WITH XMLNAMESPACES (DEFAULT 'Support_x0020_Contract_x0020_Estimate')
SELECT #data.value('(Report/table1/table1_Group1_Collection/table1_Group1/Detail_Collection/Detail/#sw_ser_no)[1]', 'nvarchar(50)') as sw_ser_no
Returns
sw_ser_no
408997-13
Edit
Extract all items as nodes:
...
SELECT t.n.value('(#sw_ser_no)[1]', 'nvarchar(50)') as sw_ser_no
FROM #data.nodes('Report/table1/table1_Group1_Collection/table1_Group1/Detail_Collection/Detail') t(n)

Related

react-native-svg not converting correctly

I cannot convert this svg for use in react native via react-native-svg
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 342.7 256.21"><defs><style>.cls-1{fill:url(#linear-gradient);}.cls-2{fill:url(#linear-gradient-2);}.cls-3{fill:url(#linear-gradient-3);}</style><linearGradient id="linear-gradient" x1="7.39" y1="65.57" x2="78.68" y2="65.57" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#244b9d"/><stop offset="0.99" stop-color="#e27b2d"/></linearGradient><linearGradient id="linear-gradient-2" x1="0" y1="163.98" x2="148.18" y2="163.98" xlink:href="#linear-gradient"/><linearGradient id="linear-gradient-3" x1="68.45" y1="120.84" x2="342.7" y2="120.84" xlink:href="#linear-gradient"/></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_2-2" data-name="Layer 2"><path class="cls-1" d="M7.39,104l.24-7.2C7.68,95.34,9,60.88,23.45,47,37.52,33.5,49.94,28.73,74.57,27.36l4.11-.23-.44,4.1c0,.46-1.29,11.51-7.59,19.84s-41.57,37-57.45,48.67Zm63.1-69.35c-20,1.57-30.25,5.93-42.2,17.39C19.58,60.4,16.37,79,15.23,89.47,34.31,74.93,60.42,53,65.07,46.85A34.39,34.39,0,0,0,70.49,34.65Z"/><path class="cls-2" d="M83.81,256.21a74,74,0,0,1-11.94-.95A85.58,85.58,0,0,1,7.93,206.49c-10.57-23.69-10.57-48.27,0-73.06,11.49-27,57.07-56.33,59-57.57l6.45-4.12-1.11,7.58c-3.64,24.85-12.69,92-10.91,104.24C63.4,197.74,68.12,205,82.4,216c11.24,8.65,45.05,12.32,57.13,13l8.65.49-6.57,5.65C132.39,243.1,109.85,256.21,83.81,256.21ZM64.2,86.15c-13,9.1-41.66,30.77-49.85,50-9.9,23.25-9.9,45.32,0,67.46A78.47,78.47,0,0,0,73,248.35c23.13,3.75,44.65-5.67,56.6-13.15-14.22-1.43-40.39-5.14-51.46-13.65-15.63-12-21.4-21-23.72-37C52.5,171.43,61,108.57,64.2,86.15Z"/><path class="cls-3" d="M202.06,241.69c-20.22,0-41.94-7.08-58.33-20.13-8.35.14-51.79-.28-68.77-22.69l-6.51-8.58,10.3,3.11c.65.19,14.21,4,24.07-6.5,7.92-8.44,9.62-28.47,11.12-46.14.53-6.22,1-12.1,1.77-17.62,1.69-12.67,9.12-27.23,19.88-38.95a84,84,0,0,1,47.55-26.36L187.9,57l-.69,4.79c-.09.59-8.62,59.63-11.93,89.82-1.51,13.78,4.51,20.71,9.83,24.1,8.17,5.21,19,4.91,24.44,1.64,11.43-6.93,13.06-13.67,14.39-24,1.39-10.8,12.29-91.66,14.95-108.34,3-18.63,21.2-37.82,40.66-42.78,26.83-6.84,48.72,2,58.54,23.59L342.7,36l-9.59-5.69c-2.95-1.75-11.83-5.9-17.3-4.15-7,2.22-12.47,9-13.7,14.26-1.4,5.92-13.36,90.21-17.48,125.74-3.69,31.89-20.32,53.88-52.35,69.2C223.35,239.64,212.92,241.69,202.06,241.69Zm-55.93-27.21,1,.85c23.23,19.1,58.53,25,82.11,13.73,30.05-14.38,45-34,48.42-63.7,3.93-33.91,16-119.53,17.61-126.54S304,22.59,313.69,19.5c4-1.29,8.6-.74,12.59.37C312.86,3.4,291,6.58,281.28,9.05c-18.44,4.7-33.24,23-35.48,37.1-2.65,16.63-13.52,97.35-14.92,108.13-1.45,11.26-3.67,20.54-17.7,29.05-8.52,5.16-22.2,4.42-31.83-1.72-9.89-6.31-14.51-17.23-13-30.77,2.76-25.16,9.12-70.21,11.25-85.12-34.61,8.37-54.37,39.16-56.92,58.35-.72,5.35-1.21,11.15-1.73,17.28-1.68,19.73-3.41,40.13-13,50.34a29.86,29.86,0,0,1-20.65,9.47c19.83,14.59,57.1,13.38,57.53,13.37Z"/></g></g></svg>
My output is
import React, { memo } from 'react'
import Svg, { Defs, LinearGradient, Stop, G, Path } from 'react-native-svg' //12.1.1
const Icon = memo(
({ color, size = 120, style, ...rest }: IconProps) => {
return (
<Svg viewBox="0 0 120 120" width={size} height={size} {...rest}>
<Defs>
<LinearGradient
id="linear-gradient"
x1={7.39}
y1={65.57}
x2={78.68}
y2={65.57}
gradientUnits="userSpaceOnUse"
>
<Stop offset={0} stopColor="#244b9d" />
<Stop offset={0.99} stopColor="#e27b2d" />
</LinearGradient>
<LinearGradient
id="linear-gradient-2"
x1={0}
y1={163.98}
x2={148.18}
y2={163.98}
/>
<LinearGradient
id="linear-gradient-3"
x1={68.45}
y1={120.84}
x2={342.7}
y2={120.84}
/>
</Defs>
<G id="Layer_2" data-name="Layer 2">
<G id="Layer_2-2" data-name="Layer 2">
<Path
d="M7.39 104l.24-7.2C7.68 95.34 9 60.88 23.45 47c14.07-13.5 26.49-18.27 51.12-19.64l4.11-.23-.44 4.1c0 .46-1.29 11.51-7.59 19.84s-41.57 37-57.45 48.67zm63.1-69.35c-20 1.57-30.25 5.93-42.2 17.39C19.58 60.4 16.37 79 15.23 89.47 34.31 74.93 60.42 53 65.07 46.85a34.39 34.39 0 005.42-12.2z"
fill="url(#linear-gradient)"
/>
<Path
d="M83.81 256.21a74 74 0 01-11.94-.95 85.58 85.58 0 01-63.94-48.77c-10.57-23.69-10.57-48.27 0-73.06 11.49-27 57.07-56.33 59-57.57l6.45-4.12-1.11 7.58c-3.64 24.85-12.69 92-10.91 104.24C63.4 197.74 68.12 205 82.4 216c11.24 8.65 45.05 12.32 57.13 13l8.65.49-6.57 5.65c-9.22 7.96-31.76 21.07-57.8 21.07zM64.2 86.15c-13 9.1-41.66 30.77-49.85 50-9.9 23.25-9.9 45.32 0 67.46A78.47 78.47 0 0073 248.35c23.13 3.75 44.65-5.67 56.6-13.15-14.22-1.43-40.39-5.14-51.46-13.65-15.63-12-21.4-21-23.72-37-1.92-13.12 6.58-75.98 9.78-98.4z"
fill="url(#linear-gradient-2)"
/>
<Path
d="M202.06 241.69c-20.22 0-41.94-7.08-58.33-20.13-8.35.14-51.79-.28-68.77-22.69l-6.51-8.58 10.3 3.11c.65.19 14.21 4 24.07-6.5 7.92-8.44 9.62-28.47 11.12-46.14.53-6.22 1-12.1 1.77-17.62 1.69-12.67 9.12-27.23 19.88-38.95a84 84 0 0147.55-26.36l4.76-.83-.69 4.79c-.09.59-8.62 59.63-11.93 89.82-1.51 13.78 4.51 20.71 9.83 24.1 8.17 5.21 19 4.91 24.44 1.64 11.43-6.93 13.06-13.67 14.39-24 1.39-10.8 12.29-91.66 14.95-108.34 3-18.63 21.2-37.82 40.66-42.78 26.83-6.84 48.72 2 58.54 23.59L342.7 36l-9.59-5.69c-2.95-1.75-11.83-5.9-17.3-4.15-7 2.22-12.47 9-13.7 14.26-1.4 5.92-13.36 90.21-17.48 125.74-3.69 31.89-20.32 53.88-52.35 69.2-8.93 4.28-19.36 6.33-30.22 6.33zm-55.93-27.21l1 .85c23.23 19.1 58.53 25 82.11 13.73 30.05-14.38 45-34 48.42-63.7 3.93-33.91 16-119.53 17.61-126.54S304 22.59 313.69 19.5c4-1.29 8.6-.74 12.59.37C312.86 3.4 291 6.58 281.28 9.05c-18.44 4.7-33.24 23-35.48 37.1-2.65 16.63-13.52 97.35-14.92 108.13-1.45 11.26-3.67 20.54-17.7 29.05-8.52 5.16-22.2 4.42-31.83-1.72-9.89-6.31-14.51-17.23-13-30.77 2.76-25.16 9.12-70.21 11.25-85.12-34.61 8.37-54.37 39.16-56.92 58.35-.72 5.35-1.21 11.15-1.73 17.28-1.68 19.73-3.41 40.13-13 50.34a29.86 29.86 0 01-20.65 9.47c19.83 14.59 57.1 13.38 57.53 13.37z"
fill="url(#linear-gradient-3)"
/>
</G>
</G>
</Svg>
)
}
)
No matter what I do it only seems to render the first Path and the rest is missing. it doesn't appear to be cut off by the viewBox either. Not sure what to do to get this svg to render correctly.
How it renders on web
Adding stops get me further but still not working correctly
Update: Adding stop, moving width and height to wrapping View and adjusting the viewport gets the svg to render. however the gradient is messed up on the second and third path
const Icon = memo(
({ color, size = 60, style, ...rest }: IconProps) => {
return (
<View style={{ width: size, height: size }}>
<Svg viewBox="0 0 360 360" {...rest}>
<Defs>
<LinearGradient
id="linear-gradient"
x1={7.39}
y1={65.57}
x2={78.68}
y2={65.57}
gradientUnits="userSpaceOnUse"
>
<Stop offset={0} stopColor="#244b9d" />
<Stop offset={0.99} stopColor="#e27b2d" />
</LinearGradient>
<LinearGradient
id="linear-gradient-2"
x1={0}
y1={163.98}
x2={148.18}
y2={163.98}
>
<Stop offset={0} stopColor="#244b9d" />
<Stop offset={0.99} stopColor="#e27b2d" />
</LinearGradient>
<LinearGradient
id="linear-gradient-3"
x1={68.45}
y1={120.84}
x2={342.7}
y2={120.84}
>
<Stop offset={0} stopColor="#244b9d" />
<Stop offset={0.99} stopColor="#e27b2d" />
</LinearGradient>
</Defs>
<G id="Layer_2" data-name="Layer 2">
<G id="Layer_2-2" data-name="Layer 2">
<Path
d="M7.39 104l.24-7.2C7.68 95.34 9 60.88 23.45 47c14.07-13.5 26.49-18.27 51.12-19.64l4.11-.23-.44 4.1c0 .46-1.29 11.51-7.59 19.84s-41.57 37-57.45 48.67zm63.1-69.35c-20 1.57-30.25 5.93-42.2 17.39C19.58 60.4 16.37 79 15.23 89.47 34.31 74.93 60.42 53 65.07 46.85a34.39 34.39 0 005.42-12.2z"
fill="url(#linear-gradient)"
/>
<Path
d="M83.81 256.21a74 74 0 01-11.94-.95 85.58 85.58 0 01-63.94-48.77c-10.57-23.69-10.57-48.27 0-73.06 11.49-27 57.07-56.33 59-57.57l6.45-4.12-1.11 7.58c-3.64 24.85-12.69 92-10.91 104.24C63.4 197.74 68.12 205 82.4 216c11.24 8.65 45.05 12.32 57.13 13l8.65.49-6.57 5.65c-9.22 7.96-31.76 21.07-57.8 21.07zM64.2 86.15c-13 9.1-41.66 30.77-49.85 50-9.9 23.25-9.9 45.32 0 67.46A78.47 78.47 0 0073 248.35c23.13 3.75 44.65-5.67 56.6-13.15-14.22-1.43-40.39-5.14-51.46-13.65-15.63-12-21.4-21-23.72-37-1.92-13.12 6.58-75.98 9.78-98.4z"
fill="url(#linear-gradient-2)"
/>
<Path
d="M202.06 241.69c-20.22 0-41.94-7.08-58.33-20.13-8.35.14-51.79-.28-68.77-22.69l-6.51-8.58 10.3 3.11c.65.19 14.21 4 24.07-6.5 7.92-8.44 9.62-28.47 11.12-46.14.53-6.22 1-12.1 1.77-17.62 1.69-12.67 9.12-27.23 19.88-38.95a84 84 0 0147.55-26.36l4.76-.83-.69 4.79c-.09.59-8.62 59.63-11.93 89.82-1.51 13.78 4.51 20.71 9.83 24.1 8.17 5.21 19 4.91 24.44 1.64 11.43-6.93 13.06-13.67 14.39-24 1.39-10.8 12.29-91.66 14.95-108.34 3-18.63 21.2-37.82 40.66-42.78 26.83-6.84 48.72 2 58.54 23.59L342.7 36l-9.59-5.69c-2.95-1.75-11.83-5.9-17.3-4.15-7 2.22-12.47 9-13.7 14.26-1.4 5.92-13.36 90.21-17.48 125.74-3.69 31.89-20.32 53.88-52.35 69.2-8.93 4.28-19.36 6.33-30.22 6.33zm-55.93-27.21l1 .85c23.23 19.1 58.53 25 82.11 13.73 30.05-14.38 45-34 48.42-63.7 3.93-33.91 16-119.53 17.61-126.54S304 22.59 313.69 19.5c4-1.29 8.6-.74 12.59.37C312.86 3.4 291 6.58 281.28 9.05c-18.44 4.7-33.24 23-35.48 37.1-2.65 16.63-13.52 97.35-14.92 108.13-1.45 11.26-3.67 20.54-17.7 29.05-8.52 5.16-22.2 4.42-31.83-1.72-9.89-6.31-14.51-17.23-13-30.77 2.76-25.16 9.12-70.21 11.25-85.12-34.61 8.37-54.37 39.16-56.92 58.35-.72 5.35-1.21 11.15-1.73 17.28-1.68 19.73-3.41 40.13-13 50.34a29.86 29.86 0 01-20.65 9.47c19.83 14.59 57.1 13.38 57.53 13.37z"
fill="url(#linear-gradient-3)"
/>
</G>
</G>
</Svg>
</View>
)
}
)
Result

Errors when trying to extract jar file with java 8 from intellij

I am trying to extract a jar file with java 8 from IntelliJ using libraries of fontawesomefx-8.92, jfoenix and SQLite-JDBC-3.27.2.12, with this method :
File > Project Structure > artifacts > Add; and if I run the jar file from
out > artifacts > DemoCreditApp_jar > DemoCreditApp.jar , I encountered these errors :
Exception in Application start method java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown
Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown
Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source) Caused by: java.lang.RuntimeException: Exception in
Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown
Source)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown
Source)
at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError:
com/sun/javafx/css/converters/PaintConverter
at com.jfoenix.controls.JFXTextField$StyleableProperties.<clinit>(JFXTextField.java:212)
at com.jfoenix.controls.JFXTextField.<init>(JFXTextField.java:163)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(Unknown
Source)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(Unknown
Source)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at Views.Main.start(Main.java:27)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown
Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown
Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown
Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown
Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown
Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native
Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown
Source)
... 1 more Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown
Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown
Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
...23 more Exception running application Views.Main
I didn't understand what is meant by the error of the path, here is my code source of Main :
package Views;
import Controllers.PagePrincipaleController;
import Controllers.SqliteConnection;
import Controllers.Values;
import Models.Patient;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.TableView;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
/**
* Created by Amine Daikha
*/
public class Main extends Application {
#Override
public void start(Stage primaryStage) throws Exception {
Values.sqliteConnection = new SqliteConnection();
Values.courentPatient = new Patient();
Values.tableInfo = new TableView<Patient>();
FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("PagePrincipaleView.fxml"));
AnchorPane pane = fxmlLoader.load();
PagePrincipaleController pagePrincipaleController = fxmlLoader.getController();
pagePrincipaleController.setMain(this);
//fxmlLoader = new FXMLLoader(new File("src/Views/PagePrincipaleView.fxml").toURI().toURL());
//Parent root = null;
//root = fxmlLoader.load(getClass().getResource("..\\Views\\PagePrincipaleView.fxml").openStream());
//Parent root = FXMLLoader.load(getClass().getResource("PagePrincipaleView.fxml"));
//Parent root = FXMLLoader.load(getClass().getResource("Views\\ScrollesPaneView.fxml"));
primaryStage.setTitle("Transactions Commerciales");
primaryStage.setScene(new Scene(pane, 1050, 570));
primaryStage.setMaxWidth(1065);
primaryStage.setMaxHeight(600);
primaryStage.show();
Values.pagePrincipaleSage = primaryStage;
}
public static void main(String[] args) {
launch(Main.class,args);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import com.jfoenix.controls.JFXTextField?>
<?import com.jfoenix.controls.JFXButton?>
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
<?import com.jfoenix.controls.JFXComboBox?>
<AnchorPane fx:id="pagePrincipale" prefHeight="550.0" prefWidth="1050.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="Controllers.PagePrincipaleController">
<children>
<TabPane prefHeight="570.0" prefWidth="1050.0" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab text="CLIENTS">
<content>
<AnchorPane layoutX="-1.0" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<HBox layoutX="210.0" prefHeight="430.0" prefWidth="841.0">
<children>
<TableView fx:id="tableInfo" prefHeight="430.0" prefWidth="841.0">
<columns>
<TableColumn fx:id="idCol" prefWidth="150.0" text="Numéro de téléphone" />
<TableColumn fx:id="nomCol" prefWidth="158.0" text="Nom" />
<TableColumn fx:id="prenomCol" prefWidth="211.0" text="Prénom" />
<TableColumn fx:id="dateCol" prefWidth="163.0" text="Date de dernier opération" />
<TableColumn fx:id="prixColA" minWidth="4.0" prefWidth="157.0" text="Endettement actuel (DA)" />
</columns>
</TableView>
</children>
</HBox>
<VBox prefHeight="437.0" prefWidth="210.0">
<children>
<JFXTextField fx:id="rechercherClient" onAction="#rechercherClientAction" promptText="Rechercher un client">
<VBox.margin>
<Insets bottom="20.0" left="4.0" right="4.0" top="20.0" />
</VBox.margin>
</JFXTextField>
<Label prefHeight="35.0" prefWidth="210.0" text="Ajouter nouveau Client">
<VBox.margin>
<Insets bottom="25.0" top="20.0" />
</VBox.margin>
<font>
<Font size="18.0" />
</font>
<padding>
<Insets left="12.0" right="10.0" />
</padding>
</Label>
<JFXTextField fx:id="numTel" promptText="Numéro de téléphone">
<VBox.margin>
<Insets bottom="7.0" left="4.0" right="4.0" />
</VBox.margin>
</JFXTextField>
<Label fx:id="errLabelNumTel" textFill="#ee0a0a">
<VBox.margin>
<Insets bottom="15.0" left="13.0" right="4.0" />
</VBox.margin>
</Label>
<JFXTextField fx:id="nomClient" promptText="Nom">
<VBox.margin>
<Insets bottom="7.0" left="4.0" right="4.0" />
</VBox.margin>
</JFXTextField>
<Label fx:id="errLabelNom" textFill="#ee0a0a">
<VBox.margin>
<Insets bottom="15.0" left="13.0" right="4.0" />
</VBox.margin>
</Label>
<JFXTextField fx:id="prenomClient" layoutX="10.0" layoutY="90.0" promptText="Prénom">
<VBox.margin>
<Insets bottom="7.0" left="4.0" right="4.0" />
</VBox.margin>
</JFXTextField>
<Label fx:id="errLabelPrenom" textFill="#ee0a0a">
<VBox.margin>
<Insets bottom="15.0" left="13.0" right="4.0" />
</VBox.margin>
</Label>
<JFXTextField fx:id="prixInitialClient" promptText="Valeur de Credit">
<VBox.margin>
<Insets bottom="7.0" left="4.0" right="4.0" />
</VBox.margin>
</JFXTextField>
<Label fx:id="errLabelPrix" textFill="#ee0a0a">
<VBox.margin>
<Insets bottom="20.0" left="13.0" right="4.0" />
</VBox.margin>
</Label>
</children>
</VBox>
<JFXButton fx:id="effacerBtn" layoutX="830.0" layoutY="448.0" onAction="#effacer" prefHeight="40.0" prefWidth="190.0" style="-fx-background-color: #0fc4e4;" text="Effacer endettements" textFill="WHITE">
<font>
<Font name="System Bold" size="15.0" />
</font>
</JFXButton>
<JFXButton fx:id="modifierBtn" layoutX="530.0" layoutY="448.0" onAction="#modifier" prefHeight="40.0" prefWidth="190.0" style="-fx-background-color: #0fc4e4;" text="Modifier" textFill="WHITE">
<font>
<Font name="System Bold" size="15.0" />
</font>
</JFXButton>
<Label fx:id="errLabelClick" layoutX="526.0" layoutY="488.0" prefHeight="40.0" textFill="#bc0606">
<font>
<Font size="14.0" />
</font>
</Label>
<JFXButton fx:id="infoDetailleBtn" layoutX="226.0" layoutY="448.0" onAction="#infoDetaille" prefHeight="40.0" prefWidth="190.0" style="-fx-background-color: #0fc4e4;" text="Transactions" textFill="WHITE">
<font>
<Font name="System Bold" size="15.0" />
</font></JFXButton>
<JFXButton fx:id="ajouterClientBtn" layoutX="5.0" layoutY="424.0" onAction="#ajouterClient" prefHeight="38.0" prefWidth="195.0" style="-fx-background-color: #0e9615;" text="Ajouter" textFill="WHITE">
<font>
<Font name="System Bold" size="15.0" />
</font>
</JFXButton>
<FontAwesomeIconView glyphName="EDIT" layoutX="685.0" layoutY="475.0" size="18.0" text="" />
<FontAwesomeIconView fill="#dd0d0d" glyphName="REMOVE" layoutX="1003.0" layoutY="475.0" size="18.0" text="" />
<FontAwesomeIconView fill="WHITE" glyphName="PLUS" layoutX="154.0" layoutY="451.0" size="18.0" text="" wrappingWidth="23.142857551574707" />
<FontAwesomeIconView fill="#14860c" glyphName="ARROW_UP" layoutX="387.0" layoutY="470.0" />
<FontAwesomeIconView fill="#dd0d0d" glyphName="ARROW_DOWN" layoutX="376.0" layoutY="479.0" />
<FontAwesomeIconView fill="#dd0d0d" glyphName="POWER_OFF" layoutX="84.0" layoutY="518.0" onMousePressed="#ett" size="30.0" text="" wrappingWidth="20.714284896850586" />
<Label layoutX="906.0" layoutY="514.0" text="Amine DAIKHA © 2019" underline="true" />
</children>
</AnchorPane>
</content>
</Tab>
<Tab text="STATISTIQUES">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<FontAwesomeIconView fill="#dd0d0d" glyphName="POWER_OFF" layoutX="84.0" layoutY="518.0" onKeyPressed="#ett" onMousePressed="#ett" size="30.0" text="" wrappingWidth="32.714284896850586" />
<Label layoutX="105.0" layoutY="25.0" text="Totale d'endettements: ">
<font>
<Font size="18.0" />
</font>
</Label>
<Label fx:id="totalEndettments" layoutX="310.0" layoutY="25.0" text="DA">
<font>
<Font size="18.0" />
</font>
</Label>
<Label layoutX="105.0" layoutY="93.0" text="les clients qui n'ont pas payé leurs endettements il y a : ">
<font>
<Font size="16.0" />
</font>
</Label>
<TableView fx:id="tableInfo1" layoutX="105.0" layoutY="130.0" prefHeight="113.0" prefWidth="841.0">
<columns>
<TableColumn fx:id="idCol1" prefWidth="150.0" text="Numéro de téléphone" />
<TableColumn fx:id="nomCol1" prefWidth="158.0" text="Nom" />
<TableColumn fx:id="prenomCol1" prefWidth="211.0" text="Prénom" />
<TableColumn fx:id="dateCol1" prefWidth="163.0" text="Date de dernier opération" />
<TableColumn fx:id="prixColA1" minWidth="4.0" prefWidth="157.0" text="Endettement actuel (DA)" />
</columns>
</TableView>
<TableView fx:id="tableInfo2" layoutX="105.0" layoutY="326.0" prefHeight="113.0" prefWidth="841.0">
<columns>
<TableColumn fx:id="idCol2" prefWidth="150.0" text="Numéro de téléphone" />
<TableColumn fx:id="nomCol2" prefWidth="158.0" text="Nom" />
<TableColumn fx:id="prenomCol2" prefWidth="211.0" text="Prénom" />
<TableColumn fx:id="dateCol2" prefWidth="163.0" text="Date de dernier opération" />
<TableColumn fx:id="prixColA2" minWidth="4.0" prefWidth="157.0" text="Endettement actuel (DA)" />
</columns>
</TableView>
<Label layoutX="105.0" layoutY="289.0" text="les clients qui leurs endettements passent : ">
<font>
<Font size="16.0" />
</font>
</Label>
<JFXComboBox fx:id="temps" layoutX="518.0" layoutY="93.0" />
<JFXComboBox fx:id="largent" layoutX="421.0" layoutY="289.0" />
<Label layoutX="906.0" layoutY="514.0" text="Amine DAIKHA © 2019" underline="true" />
</children></AnchorPane>
</content>
</Tab>
</tabs>
</TabPane>
</children>
</AnchorPane>
I have spent the whole day please guide me.

How do I pick a value from XML column in a table with a condition. XML form contains different page

I have a xml data column. The XML data contains a form with different page headers. Each page has radio type values. I need to pick the value from one page and its values.
I need the value 'id' from Page topic='Outreach' under that, Question value="Type of Outreach", in that i need the id="1" value and also i need the id value from Question value="Reason for Assessment".
Below is the sample xml data.
<Test name="Assessment " header="" logoimg="" background="" icon="" firstPage="1" allow_abort="1" is_um="0" is_hidden="0" do_only="1" status="1" locale_id="0" version="74" category_id="150011" maxQuestionID="37" id="10234" force_start="0" user_name=" ggg bbb">
<PAGE topic="Outreach " progress="5" background="" headerid="" footerid="" flush_concepts="1" lastPage="false" id="1">
<BRANCH_CONDITION>
<NEXT_PAGE id="2" />
</BRANCH_CONDITION>
<QUESTION value="Type of Outreach " defaultvalue="" style="" tooltip="" read_only="0" usability="5" prefer_concept="0" type="radio" validation="0" id="1" pagename="Outreach ">
<OPTIONS>
<OPTION value="Outbound Telephone " id="1" url="" score="0" />
<OPTION value="Inbound Telephone" id="2" url="" score="0" />
<OPTION value="In Person" id="3" url="" score="0" />
</OPTIONS>
</QUESTION>
<QUESTION value="Reason for Assessment " defaultvalue="" style="" tooltip="" read_only="0" usability="5" prefer_concept="0" type="radio" validation="0" id="2" pagename="Outreach ">
<OPTIONS>
<OPTION value="New" id="1" url="" score="0" />
<OPTION value="Annual" id="2" url="" score="0" />
<OPTION value="Triggering Event " id="3" url="" score="0" />
<OPTION value="LOC Review" id="4" url="" score="0" />
</OPTIONS>
</QUESTION>
I tried the following sql.
SELECT TABLE.META_DATA.value('(/QUESTION//id/node())[1]','int') as outReach
,TABLE.META_DATA.value('(/QUESTION//id/node())[1]','int') as ReasonForAssessment
FROM Table
Below is my expected result
+----------+---------------------+
| Outreach | ReasonForAssessment |
+----------+---------------------+
| 1 | 2 |
Several issues:
QUESTION is not the root of the XML so you must use // or walk down tree from root: /Test/PAGE/QUESTION/.
Adjust XPath to search by attribute with # prefix and not node search as id is an attribute (not child node) of QUESTION.
Adjust node index, [#], to return the corresponding #id attribute value.
Adjusted SQL:
SELECT TABLE.META_DATA.value('(//QUESTION/#id)[1]','int') as outReach
, TABLE.META_DATA.value('(//QUESTION/#id)[2]','int') as ReasonForAssessment
FROM Table;
-- outReach ReasonForAssessment
-- 1 2
Alternatively use bracketed conditionals for columns:
SELECT TABLE.META_DATA.value('(/Test/PAGE/QUESTION[#value=''Type of Outreach '']/#id)[1]','int') as outReach
, TABLE.META_DATA.value('(/Test/PAGE/QUESTION[#value=''Reason for Assessment '']/#id)[1]','int') as ReasonForAssessment
FROM Table;
-- outReach ReasonForAssessment
-- 1 2

What is the best strategy for testing D3/HighCharts/SVG?

Our server generates the data and then the client generates charts using HighCharts which is SVG. We are struggling to write an automated test in order to verify that the generated chart is correct.
This is what the SVG HighCharts generates
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="347" height="450"><desc>Created with Highcharts 3.0.2</desc><defs><clipPath id="highcharts-1"><rect fill="none" x="0" y="0" width="272" height="275"></rect></clipPath></defs><rect rx="5" ry="5" fill="#FFFFFF" x="0" y="0" width="347" height="450"></rect><g class="highcharts-button" style="cursor:default;" title="Chart context menu" stroke-linecap="round" transform="translate(313,10)"><title>Chart context menu</title><rect rx="2" ry="2" fill="white" x="0.5" y="0.5" width="24" height="22" stroke="none" stroke-width="1"></rect><path fill="#E0E0E0" d="M 6 6.5 L 20 6.5 M 6 11.5 L 20 11.5 M 6 16.5 L 20 16.5" stroke="#666" stroke-width="3" zIndex="1"></path><text x="0" y="13" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:12px;color:black;fill:black;" zIndex="1"></text></g><g class="highcharts-grid" zIndex="1"></g><g class="highcharts-grid" zIndex="1"><path fill="none" d="M 65 211.5 L 337 211.5" stroke="#C0C0C0" stroke-width="1" zIndex="1" opacity="1"></path><path fill="none" d="M 65 106.5 L 337 106.5" stroke="#C0C0C0" stroke-width="1" zIndex="1" opacity="1"></path><path fill="none" d="M 65 315.5 L 337 315.5" stroke="#C0C0C0" stroke-width="1" zIndex="1" opacity="1"></path></g><g class="highcharts-axis" zIndex="2"><path fill="none" d="M 142.5 316 L
142.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 181.5 316 L 181.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 219.5 316 L
219.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 258.5 316 L 258.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 297.5 316 L
297.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 336.5 316 L 336.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 103.5 316 L
103.5 321" stroke="#C0D0E0" stroke-width="1" opacity="1"></path><path fill="none" d="M 65.5 316 L 65.5 321" stroke="#C0D0E0" stroke-width="1"></path><text x="201" y="373" style="font-family:Tahoma, Arial, sans-serif;font-size:9pt;color:#505050;font-weight:bold;fill:#505050;" zIndex="7" text-anchor="middle" transform="translate(0,0)" visibility="visible"><tspan x="201">Project</tspan></text><path fill="none" d="M 65 315.5 L 337 315.5" stroke="#505050" stroke-width="1" zIndex="7" visibility="visible"></path></g><g class="highcharts-axis" zIndex="2"><text x="24.9375" y="178" style="font-family:Tahoma, Arial, sans-serif;font-size:9pt;color:#505050;font-weight:bold;fill:#505050;" zIndex="7" text-anchor="middle" transform="translate(0,0) rotate(270
24.9375 178)" visibility="visible"><tspan x="24.9375">Percent Complete (%)</tspan></text></g><g class="highcharts-series-group" zIndex="3"><g class="highcharts-series highcharts-tracker highcharts-tracker highcharts-tracker highcharts-tracker" visibility="visible" zIndex="0.1" transform="translate(65,40) scale(1 1)" style="" clip-path="url(#highcharts-1)"><rect fill="#9F2727" x="3.5" y="275.5" width="31" height="0" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="42.5" y="275.5" width="31" height="0" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="81.5" y="59.5" width="31" height="216" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="120.5" y="144.5" width="31" height="131" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="159.5" y="13.5" width="31" height="262" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="198.5" y="236.5" width="31" height="39" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect><rect fill="#9F2727" x="237.5" y="72.5" width="31" height="203" stroke="#FFFFFF" stroke-width="1" rx="0" ry="0"></rect></g><g class="highcharts-markers" visibility="visible" zIndex="0.1" transform="translate(65,40) scale(1 1)"></g></g><g class="highcharts-data-labels highcharts-tracker highcharts-tracker highcharts-tracker highcharts-tracker" visibility="visible" zIndex="6" transform="translate(65,40) scale(1 1)" style=""><g zIndex="1" style="cursor:default;" transform="translate(16,256)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"></text></g><g zIndex="1" style="cursor:default;" transform="translate(55,256)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"></text></g><g zIndex="1" style="cursor:default;" transform="translate(82,40)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">41%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(121,125)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">25%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(160,-6)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">50%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(202,217)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">8%</tspan></text></g><g zIndex="1" style="cursor:default;" transform="translate(238,53)" visibility="inherit"><text x="3" y="15" style="font-family:"HelveticaNeue-Roman", "HelveticaNeue", "Helvetica Neue", "Helvetica", "Arial", sans-serif;font-size:11px;color:#000000;line-height:14px;fill:#000000;" zIndex="1"><tspan x="3">39%</tspan></text></g></g><g class="highcharts-legend" zIndex="7" transform="translate(94,404)"><rect rx="5" ry="5" fill="#FFFFFF" x="0" y="0" width="158" height="31" visibility="visible"></rect><g zIndex="1"><g><g class="highcharts-legend-item" zIndex="1" transform="translate(8,3)"><text x="21" y="15" style="font-family:Tahoma, Arial, sans-serif;font-size:9pt;cursor:pointer;color:#274b6d;fill:#274b6d;" text-anchor="start" zIndex="2"><tspan x="21">Percent Complete-Sum</tspan></text><rect rx="2" ry="2" fill="#9F2727" x="0" y="4" width="16" height="12" zIndex="3"></rect></g></g></g></g><g class="highcharts-axis-labels" zIndex="7"></g><g class="highcharts-axis-labels" zIndex="7"><text x="57" y="322.3421875" style="font-family:Tahoma, Arial, sans-serif;font-size:8pt;width:116px;color:#666;cursor:default;line-height:14px;fill:#666;" text-anchor="end" opacity="1"><tspan x="57">0</tspan></text><text x="57" y="217.19933035714288" style="font-family:Tahoma, Arial, sans-serif;font-size:8pt;width:116px;color:#666;cursor:default;line-height:14px;fill:#666;" text-anchor="end" opacity="1"><tspan x="57">20%</tspan></text><text x="57" y="112.05647321428572" style="font-family:Tahoma, Arial, sans-serif;font-size:8pt;width:116px;color:#666;cursor:default;line-height:14px;fill:#666;" text-anchor="end" opacity="1"><tspan x="57">40%</tspan></text></g><g class="highcharts-tooltip" zIndex="8" style="cursor:default;padding:0;white-space:nowrap;" visibility="hidden" transform="translate(46,45)" opacity="0"><rect rx="3" ry="3" fill="none" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" isShadow="true" stroke="black" stroke-opacity="0.049999999999999996" stroke-width="5" transform="translate(1, 1)"></rect><rect rx="3" ry="3" fill="none" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" isShadow="true" stroke="black" stroke-opacity="0.09999999999999999" stroke-width="3" transform="translate(1, 1)"></rect><rect rx="3" ry="3" fill="none" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" isShadow="true" stroke="black" stroke-opacity="0.15" stroke-width="1" transform="translate(1, 1)"></rect><rect rx="3" ry="3" fill="rgb(255,255,255)" x="0.5" y="0.5" width="182" height="31" fill-opacity="0.85" stroke="#9F2727" stroke-width="1" anchorX="194.5" anchorY="8"></rect></g></svg>
Our current strategy is to generate the SVG baselines in all browsers, save them, rerun the SVG generation using selenium driver and compare the two XML response naively.
However we noticed that the DPI and the browser heavily affects height and width of the svg, which makes the tests brittle. We also tried taking screenshots of the two charts and comparing however it was very resolution dependent.
Currently we complement the UI tests with unit tests that makes sures the input to highcharts is correct, but we want to make sure we cover all the bases.
Please help us determine the correct strategy to test SVG elements generated by libraries like highcharts and d3.js.
Thank you very much.
I think you're on the right path, using Selenium to verify the dimensions of the various elements of the chart. The key is to verify their relative dimensions compared to the <svg>'s size, maybe allowing a small margin of error, and not their absolute ones.

Site Map issue with format in VB 2010

<siteMapNode url="Customer support.aspx" title="Customer support" description=""/>
<siteMapNode url="ProductRegistration.aspx" title="Register products" description=""/>
<siteMapNode url="CustomerSurvey.aspx" title="Complete customer survey" description=""/>
<siteMapNode url="ContactUs.aspx" title="Contact us" description=""/>
<siteMapNode url="TechnicianSupport.aspx" title="Technician support" description=""/>
<siteMapNode url="CustomerIncidentDisplay.aspx" title="Display customer incidents" description=""/>
<siteMapNode url="IncidentUpdate.aspx" title="Update incidents" description="">
</siteMapNode>
<siteMapNode url="Administration.aspx" title="Administration" description=""/>
<siteMapNode url="ProductMaintenance.aspx" title="Maintain products" description=""/>
<siteMapNode url="CustomerMaintenance.aspx" title="Maintain customers" description=""/>
<siteMapNode url="TechnicianMaintenance.aspx" title="Maintain technicians" description=""/>
<siteMapNode url="IncidentCreation.aspx" title="Create incidents" description=""/>
<siteMapNode url="TechnicianIncidentSummary.aspx" title="Display techninican incidents" description=""/>
<siteMapNode url="IncidentAssignment.aspx" title="Assign incidents" description=""/>
<siteMapNode url="IncidentDisplay.aspx" title="Display incidents" description=""/>
<siteMapNode url="CustomerDisplay.aspx" title="Display customers" description=""/>
<siteMapNode url="Map.aspx" title="Site Map" description="">
</siteMapNode>
It doesn't turn out exactly right... When I add a TreeView to my Map.aspx webpage It shows Home as the only Parent Node. Home should be the main with Customer Support, Technician support, and administration as the next head nodes then all others under that.
Does this make sense?
Home is the root node that all the other nodes are under.
I've never used the TreeView personally, but when I used a SiteMapDataSource to build a navigation menu, I set ShowStartingNode="false" to skip the root node.