WordprocessingML parsing using XPath, XQuery or XPathNavigator - xpath

I am dealing with the word processing ML (Office Word file) using XPath expressions. Due to the nature of bookmarks placed in document, the starting of bookmark may be somewhere else and then the end. So they dont really follow any well formed XML hierarchy, so thats the challenge writing XPath expressions for such bookmarked content to read from document.xml file.
Can someone please help how to handle such unusual XML parsing using XPath? e.g. below table:
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="003A3B76">
<w:bookmarkStart w:id="3" w:name="Table3"/>
</w:p>
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="0" w:type="auto"/>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="533"/>
<w:gridCol w:w="2148"/>
<w:gridCol w:w="986"/>
<w:gridCol w:w="865"/>
<w:gridCol w:w="4818"/>
</w:tblGrid>
<w:tr w:rsidR="003A3B76" w:rsidTr="005666D2">
<w:tc>
<w:tcPr>
<w:tcW w:w="533" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="BFBFBF" w:themeFill="background1" w:themeFillShade="BF"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>#</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2148" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="BFBFBF" w:themeFill="background1" w:themeFillShade="BF"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>Name</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="986" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="BFBFBF" w:themeFill="background1" w:themeFillShade="BF"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>Age</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="865" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="BFBFBF" w:themeFill="background1" w:themeFillShade="BF"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>Weight</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="4818" w:type="dxa"/>
<w:shd w:val="clear" w:color="auto" w:fill="BFBFBF" w:themeFill="background1" w:themeFillShade="BF"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>Will</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:tr w:rsidR="003A3B76" w:rsidTr="005666D2">
<w:tc>
<w:tcPr>
<w:tcW w:w="533" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>2</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="2148" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>Nagraj</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="986" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>38</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="865" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>150lb</w:t>
</w:r>
</w:p>
</w:tc>
<w:tc>
<w:tcPr>
<w:tcW w:w="4818" w:type="dxa"/>
</w:tcPr>
<w:p w:rsidR="003A3B76" w:rsidRDefault="003A3B76" w:rsidP="005666D2">
<w:r>
<w:t>Be real</w:t>
</w:r>
</w:p>
</w:tc>
</w:tr>
<w:bookmarkEnd w:id="3"/>
</w:tbl>
bookmarkEnd is ended here inside table, however not in <tr> or <tc>. and the bookmarkStart is started outside of table. That's the way scenario i have from my tagging. Please help with this. Writing a Xpath expression on this is getting complex, any help with XSLT is also welcome.

Related

How to read all attributes conditionally?

I want to read all attributes as IEnumerable using where clause.
So what I want is -
return Employee as List where List = PayList
Below is my XML.
<Employees Table="ListColumns" StartAt="1" Output="Return">
<Lists List="PayList">
<Employee Start="51" Length="11" Name="Amount"/>
<Employee Start="62" Length="6" Name="Name"/>
<Employee Start="68" Length="50" Name="Reason"/>
<Employee Start="118" Length="7" Name="Action"/>
<Employee Start="125" Length="6" Name="First"/>
<Employee Start="131" Length="6" Name="Last"/>
<Employee Start="137" Length="40" Name="Payee"/>
<Employee Start="177" Length="6" Name="Banker"/>
<Employee Start="183" Length="19" Name="DateIssued"/>
<Employee Start="202" Length="19" Name="DateStopped"/>
</Lists>
<Lists List="ResponseList">
<Employee Start="51" Length="11" Name="Amount"/>
<Employee Start="62" Length="6" Name="Name"/>
<Employee Start="68" Length="50" Name="Reason"/>
<Employee Start="118" Length="7" Name="Action"/>
<Employee Start="125" Length="6" Name="First"/>
<Employee Start="131" Length="6" Name="Last"/>
<Employee Start="137" Length="40" Name="Payee"/>
<Employee Start="177" Length="6" Name="Banker"/>
<Employee Start="183" Length="19" Name="DateIssued"/>
<Employee Start="202" Length="19" Name="DateStopped"/>
</Lists>
</Employees>
You System.Xml.Linq XElement class
XElement xml = XElement.Load("filePath");
var payList = xml.Elements("Lists").Where(list => list.Attribute("List").Value == "PayList");

Apache FOP image not hide

I set margin-right:1.0in.
The last column show the image but hide the text. I know the last column is overflow, but why the the image is showing but the text not?
How to hide all of the content include the image?
The file content is like below:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master page-height="8.5in" page-width="14.0in" margin-left="0.1in" margin-right="1.0in" margin-bottom="0.2in" margin-top="0.2in" master-name="all-pages">
<fo:region-body region-name="xsl-region-body" margin-bottom="0.1in" margin-top="0.1in"/>
<fo:region-before extent="0.1in" region-name="xsl-region-header"/>
<fo:region-after extent="0.1in" region-name="xsl-region-footer"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterParametersSet">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterColumnSet1">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterColumnSet2">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
<fo:page-sequence-master master-name="reportSeqn1PageMasterImageSet">
<fo:repeatable-page-master-reference master-reference="all-pages"/>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence force-page-count="no-force" master-reference="reportSeqn1PageMasterColumnSet1" initial-page-number="1">
<fo:static-content flow-name="xsl-region-header">
<fo:block font-family="Arial" font-size="8pt" text-align="end">Dec 07, 2016</fo:block>
<fo:block font-family="Arial" font-size="8pt" text-align="end">05:55 PM</fo:block>
<fo:block font-weight="normal" font-family="Arial" font-size="12pt" text-align="center" text-decoration="none">Finance Integration Tasks</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-footer">
<fo:block font-family="Arial" font-size="8pt" text-align="end">
Page <fo:page-number/> Column set 1 of 2</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block-container width="1653.2640000000001pt">
<fo:block font-family="Arial" font-size="8pt" margin-top="5pt">
<fo:table table-layout="fixed" width="1653.2640000000001pt">
<fo:table-column column-number="1" column-width="84.43636363636364pt"/>
<fo:table-column column-number="2" column-width="84.43636363636364pt"/>
<fo:table-column column-number="3" column-width="84.43636363636364pt"/>
<fo:table-column column-number="4" column-width="84.43636363636364pt"/>
<fo:table-column column-number="5" column-width="84.43636363636364pt"/>
<fo:table-column column-number="6" column-width="84.43636363636364pt"/>
<fo:table-column column-number="7" column-width="84.43636363636364pt"/>
<fo:table-column column-number="8" column-width="84.43636363636364pt"/>
<fo:table-column column-number="9" column-width="84.43636363636364pt"/>
<fo:table-column column-number="10" column-width="84.43636363636364pt"/>
<fo:table-column column-number="11" column-width="84.43636363636364pt"/>
<fo:table-column column-number="12" column-width="724.464pt"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)"># of Critical Issues</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Description</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)"># of Other Issues</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test1</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test2</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test3</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test4</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test5</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test6</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(51,102,153)">
<fo:block text-align="start" color="rgb(255,255,255)">Test7</fo:block>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(255,255,255)" border-top-color="rgb(255,255,255)" border-right-color="rgb(255,255,255)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block text-align="start" color="rgb(255,255,255)">title</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="#ffff00">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="left">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">Tin
Can</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Red" text-align="left" font-weight="bold">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Red" font-weight="bold" font-style="normal" text-decoration="none">ABCD</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="center">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">4</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="right">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">19</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="left">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">Tin
Can</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">ABCD</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">Tin Can</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">ABCD</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">Tin Can</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="#000000" text-align="left">ABCD</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(200,215,227)" border-top-color="rgb(200,215,227)" border-right-color="rgb(200,215,227)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="Black" text-align="right">
<fo:inline xmlns:exslt="http://exslt.org/common" color="Black" font-weight="normal" font-style="normal" text-decoration="none">Tin
Can</fo:inline>
</fo:block>
</fo:block-container>
</fo:table-cell>
<fo:table-cell padding="2pt" border-bottom-color="rgb(255,255,255)" border-top-color="rgb(255,255,255)" border-right-color="rgb(255,255,255)" border-left-color="rgb(200,215,227)" border-style="solid" border-width="0.25pt" background-color="rgb(255,255,255)">
<fo:block-container >
<fo:block font-family="Arial" color="rgb(255,255,255)" text-align="left">
<fo:inline xmlns:exslt="http://exslt.org/common" font-weight="normal" font-style="normal">ABCD</fo:inline> <fo:external-graphic src="url('file:///C:/Users/sujianrong/Desktop/fop-2.1-bin.tar/fop-2.1-bin/fop-2.1/examples/fo/graphics/fop.jpg')" content-width="10pt" /> </fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</fo:block-container>
<fo:block id="reportSeqn1last-pageColumnSet2"/>
</fo:flow>
</fo:page-sequence>
</fo:root>
Add overflow="hidden" to the fo:region-body.
See https://www.w3.org/TR/xsl11/#overflow

fxml file not behaving as expected in OS X

I am using an fxml file to to create my java fx UI.
the file is:-
<?import java.lang.String?>
<?import javafx.collections.FXCollections?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<AnchorPane fx:id="ap" maxHeight="1.7976931348623157E308"
maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity"
prefHeight="480.0" prefWidth="840.0" xmlns="http://javafx.com/javafx/8.0.65"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.Buildsapp.Main.BuildsController">
<children>
<VBox prefHeight="200.0" prefWidth="100.0"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<HBox alignment="CENTER_LEFT" spacing="20.0" VBox.vgrow="NEVER">
<padding>
<Insets bottom="12.0" left="12.0" right="12.0" top="12.0" />
</padding>
<children>
<GridPane hgap="10.0" HBox.hgrow="NEVER">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0"
vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Label prefHeight="21.0" prefWidth="88.0" text="Platform" />
<ComboBox fx:id="versionCombo" prefHeight="31.0"
prefWidth="108.0" GridPane.rowIndex="1">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="Win" />
<String fx:value="Mac" />
</FXCollections>
</items>
<value>
<String fx:value="Mac" />
</value>
</ComboBox>
<Label prefHeight="21.0" prefWidth="80.0" text="Product"
GridPane.columnIndex="1" />
<ComboBox fx:id="verCombo" prefHeight="31.0" prefWidth="127.0"
promptText="build" GridPane.columnIndex="1" GridPane.rowIndex="1">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="build" />
<String fx:value="build2" />
</FXCollections>
</items>
</ComboBox>
<Label text="Version" GridPane.columnIndex="2" />
<ComboBox fx:id="versionNo" prefHeight="31.0"
prefWidth="109.0" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<Label prefHeight="21.0" prefWidth="60.0" text="Server"
GridPane.columnIndex="3" />
<ComboBox fx:id="locCombo" prefHeight="31.0" prefWidth="103.0"
GridPane.columnIndex="3" GridPane.rowIndex="1">
<items>
<FXCollections fx:factory="observableArrayList">
<String fx:value="SJ" />
<String fx:value="MN" />
</FXCollections>
</items>
<value>
<String fx:value="SJ" />
</value>
</ComboBox>
<Button fx:id="downloadButton" minWidth="80.0"
mnemonicParsing="false" text="Download" GridPane.columnIndex="4"
GridPane.rowIndex="1" />
<Button fx:id="installButton" minWidth="80.0"
mnemonicParsing="false" text="Install" GridPane.columnIndex="5"
GridPane.rowIndex="1" />
<Button fx:id="locButton" mnemonicParsing="false"
prefHeight="31.0" prefWidth="120.0" text="Open Folder"
GridPane.columnIndex="6" GridPane.rowIndex="1" />
</children>
</GridPane>
</children>
</HBox>
<TableView fx:id="tableView" VBox.vgrow="ALWAYS">
<columns>
<TableColumn fx:id="builds" prefWidth="482.0" text="Builds" />
<TableColumn fx:id="date" minWidth="0.0" prefWidth="500.0"
text="Date" />
</columns>
</TableView>
</children>
</VBox>
</children>
</AnchorPane>
It works fine in windows while in mac when I launch the app the app window does not appear as expected but it appears as a small window on the top left corner.
The similar issue is appearing with the progress dialog which I am using it works fine in Windows but in mac(OS X) when the app is expanded like when app window size is maximum the progress dialog is also covering the whole display screen while I have given fixed size to scene window.
This is my progress bar code:-
public ProgressBar startProgressBar() {
primaryStage = new Stage();
ProgressBar pb = new ProgressBar(0);
//ProgressIndicator pi = new ProgressIndicator(0);
//pi.progressProperty().bind(pb.progressProperty());
HBox hb = new HBox();
hb.setSpacing(5);
hb.setAlignment(Pos.CENTER);
hb.getChildren().addAll(pb);
Scene scene = new Scene(hb, 300, 100);
primaryStage.setScene(scene);
primaryStage.setTitle("Downloading Build...");
primaryStage.show();
return pb;
}
I am able find the solution for the first issue that can be solved my fixing the minHight and minWidth of the anchor panel to some value in fxml file instead of infinity but I am still not able to find the solution for the second issue.

Error cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body'

I have already tried some hints but I get this problem not solved. I validated the wsdl with xmlspy-client and it says it and the xsd are valid.
When I send a Request like this with SOAPUI I get the Exception mentioned (cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body').
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:mod="http://schemas.domain.com/wsdl/fuelprice/v1/model">
<soapenv:Header/>
<soapenv:Body>
<v1:AuthenticationHeader client="client">
<v1:token>token</v1:token>
</v1:AuthenticationHeader>
<v1:GetAreaFuelStationsRequest provider="p1" prices="true">
<v1:area>
<mod:center ellipsoid="false">
<mod:latitude>22.519172</mod:latitude>
<mod:longitude>13.406093</mod:longitude>
</mod:center>
<mod:radius>10</mod:radius>
</v1:area>
</v1:GetAreaFuelStationsRequest>
</soapenv:Body>
</soapenv:Envelope>
I have tried importing the soap schema in the wsdl. After it I got an error message:
"cvc-complex-type.2.4.a: Invalid content was found starting with element 'v1:latitude'. One of '{"http://schemas.domain.com/wsdl/fuelprice/v1/model":latitude}' is expected.".
I honestly work with rest and json and have some difficulties with this schema-configuration.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="wsdl-viewer.xsl"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" xmlns:exception="http://schemas.domain.com/wsdl/fuelprice/v1/exception" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1">
<wsdl:types>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1" elementFormDefault="qualified">
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" schemaLocation="common.xsd"/>
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/exception" schemaLocation="exception.xsd"/>
<xsi:element name="GetAreaFuelStationsRequest">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="area" type="model:Area"/>
</xsi:sequence>
<xsi:attribute name="provider" type="xsi:string" use="optional"/>
<xsi:attribute name="prices" type="xsi:boolean" use="required"/>
</xsi:complexType>
</xsi:element>
<xsi:element name="GetAreaFuelStationsResponse">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="entry" type="model:SearchResult" minOccurs="0" maxOccurs="unbounded"/>
</xsi:sequence>
<xsi:attribute name="countTotal" type="xsi:int" use="optional"/>
</xsi:complexType>
</xsi:element>
</xsi:schema>
</wsdl:types>
<wsdl:message name="SearchAreaFuelStationsRequest">
<wsdl:part name="auth" element="tns:AuthenticationHeader"/>
<wsdl:part name="body" element="tns:GetAreaFuelStationsRequest"/>
</wsdl:message>
<wsdl:message name="SearchAreaFuelStationsResponse">
<wsdl:part name="body" element="tns:GetAreaFuelStationsResponse"/>
</wsdl:message>
<wsdl:portType name="FuelDataService">
<wsdl:operation name="GetAreaFuelStations">
<wsdl:input message="tns:GetAreaFuelStationsRequest"/>
<wsdl:output message="tns:GetAreaFuelStationsResponse"/>
<wsdl:fault name="ServiceError" message="tns:ServiceErrorFault"/>
<wsdl:fault name="AuthenticationError" message="tns:AuthenticationErrorFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FuelDataService" type="tns:FuelDataService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAreaFuelStations">
<soap:operation soapAction="urn:GetAreaFuelStations"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceError"/>
<wsdl:fault name="AuthenticationError"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FuelDataService">
<wsdl:port name="FuelDataService" binding="tns:FuelDataService">
<soap:address location="No target address"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" elementFormDefault="qualified">
<xsi:complexType name="FuelStation">
<xsi:sequence>
<xsi:element name="location" type="model:GeoLocation"/>
<xsi:element name="name" type="xsi:string"/>
</xsi:sequence>
<xsi:attribute name="id" type="xsi:long" use="optional"/>
</xsi:complexType>
<xsi:complexType name="GeoLocation">
<xsi:sequence>
<xsi:element name="latitude" type="xsi:double"/>
<xsi:element name="longitude" type="xsi:double"/>
</xsi:sequence>
<xsi:attribute name="ellipsoid" type="xsi:string" use="required"/>
</xsi:complexType>
<xsi:complexType name="Area">
<xsi:sequence>
<xsi:element name="center" type="model:GeoLocation"/>
<xsi:element name="radius" type="xsi:float"/>
</xsi:sequence>
</xsi:complexType>
</xsi:schema>
For me is not obvious what I should change to get this working. Does anybody knows what is wrong with the namespace setting? I would appreciate any help.
This Question was solved with the Question validating SOAP-Request with a SOAPHandler
Extracting the body of message, adding the needed namespace in the schema and validating the body as a Document did the trick.

XPath Expression to select an specific node

I'm having an issue trying to build an Xpath expression to select all the "field" nodes "name" value attribute.
I already tried: //field[#name] but it returns no matches.
The sample results I need from the XML document are: currentDate, trulyYours, claimant, dateOfLoss etc...
Thank you for your help.
<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesignerES_V9.0.0.2.20101008.1.734229" APIVersion="3.1.20001.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2012-01-23T17:23:59Z" uuid="594e6d9b-2319-4fdb-b490-4d7655e56aa0">
<template xmlns="http://www.xfa.org/schema/xfa-template/2.4/">
<?formServer defaultPDFRenderFormat acrobat7.0.5static?>
<subform name="form1" locale="en_US" layout="tb">
<pageSet>
<pageArea>
<contentArea name="ContentArea1" x="0pt" y="0pt" w="612pt" h="792pt"/>
<medium short="612pt" long="792pt" stock="custom"/>
</pageArea>
</pageSet>
<subform name="DynamicFragment">
<bind match="none"/>
<field name="currentDate" y="0mm" x="0.86mm" w="62mm" h="0.229167in" access="readOnly">
<ui>
<textEdit>
<border hand="right" presence="hidden">
<?templateDesigner StyleID aped0?></border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro"/>
<para vAlign="middle"/>
<?PDF_OBJR TextField1[3]?>
<bind match="global"/>
</field>
<field name="trulyYours" y="129.578mm" w="62mm" h="0.229167in" access="readOnly">
<ui>
<textEdit>
<border hand="right" presence="hidden">
<?templateDesigner StyleID aped0?></border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro"/>
<para vAlign="middle"/>
<?PDF_FIELD_ID 30003?>
<?PDF_OBJR TextField1[3]?>
<bind match="global"/>
</field>
<field name="claimant" y="47.624mm" x="46.135mm" w="62mm" h="0.229167in" access="readOnly">
<ui>
<textEdit>
<border hand="right" presence="hidden">
<?templateDesigner StyleID aped0?></border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro"/>
<para vAlign="middle"/>
<?PDF_FIELD_ID 30003?>
<?PDF_OBJR TextField1[3]?>
<bind match="global"/>
</field>
<field name="ourInsured" y="42.618mm" x="46.135mm" w="62mm" h="0.229167in" access="readOnly">
<ui>
<textEdit>
<border hand="right" presence="hidden">
<?templateDesigner StyleID aped0?></border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro"/>
<para vAlign="middle"/>
<?PDF_FIELD_ID 30002?>
<?PDF_OBJR TextField1[2]?>
<bind match="global"/>
</field>
<field name="dateOfLoss" y="37.127mm" x="46.135mm" w="62mm" h="0.229167in" access="readOnly">
<ui>
<textEdit>
<border hand="right" presence="hidden">
<?templateDesigner StyleID aped0?></border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro"/>
<para vAlign="middle"/>
<?PDF_FIELD_ID 30001?>
<?PDF_OBJR TextField1[1]?>
<bind match="global"/>
</field>
<field name="ourClaimNumber" y="32.132mm" x="46.153mm" w="62mm" h="0.229167in" access="readOnly">
<ui>
<textEdit>
<border hand="right" presence="hidden">
<?templateDesigner StyleID aped0?></border>
<margin/>
</textEdit>
</ui>
<font typeface="Myriad Pro"/>
<para vAlign="middle"/>
<?PDF_FIELD_ID 30001?>
<?PDF_OBJR TextField1[0]?>
<bind match="global"/>
</field>
<traversal>
<traverse operation="first" ref="currentDate[0]"/>
</traversal>
<?templateDesigner isFragment yes?>
<?templateDesigner fragmentTitle 3016DynamicFragment?></subform>
</subform>
<?templateDesigner FormTargetVersion 24?>
<?templateDesigner Zoom 89?>
<?templateDesigner Rulers horizontal:1, vertical:1, guidelines:1, crosshairs:0?></template>
<config xmlns="http://www.xfa.org/schema/xci/1.0/">
<agent name="designer">
<!-- [0..n] -->
<destination>pdf</destination>
<pdf>
<!-- [0..n] -->
<fontInfo/>
</pdf>
</agent>
<present>
<!-- [0..n] -->
<destination>pdf</destination>
<pdf>
<!-- [0..n] -->
<fontInfo/>
<version>1.65</version>
</pdf>
<xdp>
<packets>*</packets>
</xdp>
</present>
</config>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c043 52.437709, 2010/08/04-17:30:07 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
<xmp:MetadataDate>2012-01-23T17:23:59Z</xmp:MetadataDate>
<xmp:CreatorTool>Adobe LiveCycle Designer ES 9.0</xmp:CreatorTool>
</rdf:Description>
<rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
<pdf:Producer>Adobe LiveCycle Designer ES 9.0</pdf:Producer>
</rdf:Description>
<rdf:Description xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" rdf:about="">
<xmpMM:DocumentID>uuid:594e6d9b-2319-4fdb-b490-4d7655e56aa0</xmpMM:DocumentID>
</rdf:Description>
<rdf:Description xmlns:lcd="http://ns.adobe.com/livecycle/designer/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
<lcd:fragmentCatalog>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">3016DynamicFragment</rdf:li>
</rdf:Alt>
</dc:title>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default"/>
</rdf:Alt>
</dc:description>
<dc:identifier>$template.form1.DynamicFragment</dc:identifier>
<lcd:fragmentRole>Subform</lcd:fragmentRole>
</rdf:li>
</rdf:Seq>
</lcd:fragmentCatalog>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<localeSet xmlns="http://www.xfa.org/schema/xfa-locale-set/2.1/">
<locale name="en_US" desc="English (United States)">
<calendarSymbols name="gregorian">
<monthNames>
<month>January</month>
<month>February</month>
<month>March</month>
<month>April</month>
<month>May</month>
<month>June</month>
<month>July</month>
<month>August</month>
<month>September</month>
<month>October</month>
<month>November</month>
<month>December</month>
</monthNames>
<monthNames abbr="1">
<month>Jan</month>
<month>Feb</month>
<month>Mar</month>
<month>Apr</month>
<month>May</month>
<month>Jun</month>
<month>Jul</month>
<month>Aug</month>
<month>Sep</month>
<month>Oct</month>
<month>Nov</month>
<month>Dec</month>
</monthNames>
<dayNames>
<day>Sunday</day>
<day>Monday</day>
<day>Tuesday</day>
<day>Wednesday</day>
<day>Thursday</day>
<day>Friday</day>
<day>Saturday</day>
</dayNames>
<dayNames abbr="1">
<day>Sun</day>
<day>Mon</day>
<day>Tue</day>
<day>Wed</day>
<day>Thu</day>
<day>Fri</day>
<day>Sat</day>
</dayNames>
<meridiemNames>
<meridiem>AM</meridiem>
<meridiem>PM</meridiem>
</meridiemNames>
<eraNames>
<era>BC</era>
<era>AD</era>
</eraNames>
</calendarSymbols>
<datePatterns>
<datePattern name="full">EEEE, MMMM D, YYYY</datePattern>
<datePattern name="long">MMMM D, YYYY</datePattern>
<datePattern name="med">MMM D, YYYY</datePattern>
<datePattern name="short">M/D/YY</datePattern>
</datePatterns>
<timePatterns>
<timePattern name="full">h:MM:SS A Z</timePattern>
<timePattern name="long">h:MM:SS A Z</timePattern>
<timePattern name="med">h:MM:SS A</timePattern>
<timePattern name="short">h:MM A</timePattern>
</timePatterns>
<dateTimeSymbols>GyMdkHmsSEDFwWahKzZ</dateTimeSymbols>
<numberPatterns>
<numberPattern name="numeric">z,zz9.zzz</numberPattern>
<numberPattern name="currency">$z,zz9.99|($z,zz9.99)</numberPattern>
<numberPattern name="percent">z,zz9%</numberPattern>
</numberPatterns>
<numberSymbols>
<numberSymbol name="decimal">.</numberSymbol>
<numberSymbol name="grouping">,</numberSymbol>
<numberSymbol name="percent">%</numberSymbol>
<numberSymbol name="minus">-</numberSymbol>
<numberSymbol name="zero">0</numberSymbol>
</numberSymbols>
<currencySymbols>
<currencySymbol name="symbol">$</currencySymbol>
<currencySymbol name="isoname">USD</currencySymbol>
<currencySymbol name="decimal">.</currencySymbol>
</currencySymbols>
<typefaces>
<typeface name="Myriad Pro"/>
<typeface name="Minion Pro"/>
<typeface name="Courier Std"/>
<typeface name="Adobe Pi Std"/>
<typeface name="Adobe Hebrew"/>
<typeface name="Adobe Arabic"/>
<typeface name="Adobe Thai"/>
<typeface name="Kozuka Gothic Pro-VI M"/>
<typeface name="Kozuka Mincho Pro-VI R"/>
<typeface name="Adobe Ming Std L"/>
<typeface name="Adobe Song Std L"/>
<typeface name="Adobe Myungjo Std M"/>
</typefaces>
</locale>
</localeSet></xdp:xdp>
The expression you've shown -- //field[#name] -- selects all field elements that have a name attribute. What you need to do is select the attribute itself. Like this:
//field/#name
Regarding namespaces: Your target nodes are found in the http://www.xfa.org/schema/xfa-template/2.4/ namespace. Any XPath expression must take this into account with the following steps:
Register the namespace to a prefix with your XPath engine. How this is done depends on the host language you're using to evaluate the expression. In Java, for example, this is done by creating a javax.xml.namespace.NamespaceContext that gets registered with the javax.xml.xpath.XPath instance.
Use the prefix you registered in step 1) to query elements in the target namespace. So, for example, if you were to register http://www.xfa.org/schema/xfa-template/2.4/ with the prefix xfa, then you'd write the expression like this:
//xfa:field/#name
Namespace-agnostic solution: It is possible (but not necessarily recommended) to select the target nodes without accounting for namespaces with the following expression:
//*[local-name()='field']/#name
You need to assign a prefix for the namespace. The field element is not in a null namespace. It appears to be in http://www.xfa.org/schema/xfa-template/2.4/.
How you assign the namespace prefix depends on what host language you are using to issue the XPath. You don't say so we can't help you. It will probably look something like this made-up example:
xpather.registerNamespace('xfa', 'http://www.xfa.org/schema/xfa-template/2.4/');
Note that "xfa" can be any prefix you want. Only the namespace uri matters.
Once that is done, your XPath will look like this:
//xfa:field/#name
If you assign a prefix to the xpd namespace too, you can be more specific:
/xpd:xpd/xfa:template//xfa:field/#name

Resources