Skip to main content
Solved

XML Templater Error


Forum|alt.badge.img

Hi!

While using the XMLTemplater, I sometimes come across this error:

""

XMLTemplater_2(XMLTemplaterFactory): The following error occurred near line 4, column 25 of the query:

XMLTemplater_2(XMLTemplaterFactory): invalid expression: syntax error, unexpected ExprSingle (missing comma "," between expressions?)

""

What does this mean? The XML has been pasted from XMLSpy whom have no issues with the XML. Some while ago I managed to see what was wrong myself. But instead of writing it down I thought "I will remember". I did not.

Cheers!

Best answer by david_r

Try removing the comment on line 2:

<!--Sample XML file generated by XMLSpy v2016 sp1 (x64) (http://www.altova.com)-->

The XMLTemplater seems to have issues with it, and I suspect you don't really need it?

David

View original
Did this help you find an answer to your question?

8 replies

david_r
Celebrity
  • March 18, 2016

It's difficult to say without seeing the XML in question. Could you post it here?


Forum|alt.badge.img
  • Author
  • March 18, 2016

D'oh! Of course!

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2016 sp1 (x64) (http://www.altova.com)-->
<vs_core:vs_Observation xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:swe="http://www.opengis.net/swe/2.0" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ad="http://inspire.ec.europa.eu/schemas/ad/4.0" xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0" xmlns:base2="http://inspire.ec.europa.eu/schemas/base2/2.0" xmlns:vs_core="http://www.miljodatasamverkan.se/validation/core/1.0" xmlns:vs_luft="http://www.miljodatasamverkan.se/validation/luft/1.0" xsi:schemaLocation="http://www.miljodatasamverkan.se/validation/core/1.0 file://proxy.vic-metria.nu/inspire/inspire/validering/sidor/luft_smhi/xsd/Validering_Core_v1.xsd">
	<vs_core:id>String</vs_core:id>
	<vs_core:phenomenonTime gml:id="ID1">
		<gml:beginPosition>{fme:get-attribute("InfoMatning_startTid")}</gml:beginPosition>
		<gml:endPosition>{fme:get-attribute("InfoMatning_slutTid")}</gml:endPosition>
	</vs_core:phenomenonTime>
	<vs_core:resultQualty/>
	<vs_core:resultTime>{fme:get-attribute("TodaysDate")}</vs_core:resultTime>
	<vs_core:procedure>
		<vs_core:analys>
			<vs_core:ackredideratLaboratorium/>
			<vs_core:analysInstrument>
				<vs_core:beskrivning>String</vs_core:beskrivning>
				<vs_core:detektionsGräns>{fme:get-attribute("InfoMatning_detektionsgrans")}</vs_core:detektionsGräns>
				<vs_core:instrumentRedskap>{fme:get-attribute("InfoMatning_matutrustning")}</vs_core:instrumentRedskap>
			</vs_core:analysInstrument>
			<vs_core:analysMetod>
				<vs_core:likvärdigMetodredovisning>{fme:get-attribute("InfoMatning_redovisningLikvardig")}</vs_core:likvärdigMetodredovisning>
				<vs_core:namn>
					<vs_core:namn>{fme:get-attribute("InfoMatning_analytiskTeknik")}</vs_core:namn>
				</vs_core:namn>
			</vs_core:analysMetod>
		</vs_core:analys>
		<vs_core:provtagning>
			<vs_core:ackrediteradProvtagningsOrganisation>true</vs_core:ackrediteradProvtagningsOrganisation>
			<vs_core:provtagninsMetod>
				<vs_core:namn>
					<vs_core:namn>{fme:get-attribute("InfoMatning_matProvMetod")}</vs_core:namn>
				</vs_core:namn>
			</vs_core:provtagninsMetod>
			<vs_core:provtagningsStrategi>{fme:get-attribute("AllmanInfo_kontrollStrategi")}</vs_core:provtagningsStrategi>
		</vs_core:provtagning>
	</vs_core:procedure>
	<vs_core:parameter>
		<vs_core:platsspecifikParameter>
			<vs_core:luftPlatsParameter>
				<vs_luft:bilder>{fme:get-attribute("B1Info_refBilder")}</vs_luft:bilder>
				<vs_luft:emissioner>
					<vs_luft:emissionEnskildUppvärmning>{fme:get-attribute("B3Info_utslappEnskild")}</vs_luft:emissionEnskildUppvärmning>
					<vs_luft:emissionerAvstånd>{fme:get-attribute("B3Info_avstandVag")}</vs_luft:emissionerAvstånd>
					<vs_luft:emissionerNärhet>industri</vs_luft:emissionerNärhet>
					<vs_luft:emissionIndustrikällor>{fme:get-attribute("B3Info_utslappIndustri")}</vs_luft:emissionIndustrikällor>
					<vs_luft:emissionRelation>bostad</vs_luft:emissionRelation>
					<vs_luft:emissionTrafik>{fme:get-attribute("B3Info_utslappVagtrafik")}</vs_luft:emissionTrafik>
					<vs_luft:emissionÖvrigPåverkan>{fme:get-attribute("B3Info_ovrigPaverkan")}</vs_luft:emissionÖvrigPåverkan>
				</vs_luft:emissioner>
				<vs_luft:fasadHojd>{fme:get-attribute("B2Info_hojdOverMark")}</vs_luft:fasadHojd>
				<vs_luft:gataBredd>{fme:get-attribute("B1Info_gataBredd")}</vs_luft:gataBredd>
				<vs_luft:hojd>{fme:get-attribute("B1Info_hojdOverHav")}</vs_luft:hojd>
				<vs_luft:invånarantal>{fme:get-attribute("AllmanInfo_invanarAntal")}</vs_luft:invånarantal>
				<vs_luft:kartor>{fme:get-attribute("B1Info_refKarta")}</vs_luft:kartor>
				<vs_luft:kommunLan>{fme:get-attribute("B1Info_kommunKod")}</vs_luft:kommunLan>
				<vs_luft:lokalaSpridningsförutsättningar>{fme:get-attribute("B1Info_lokalaSpridnings")}</vs_luft:lokalaSpridningsförutsättningar>
				<vs_luft:luftIntag>
					<vs_luft:luftIntagAvståndFasadVägkant>{fme:get-attribute("B2Info_avstandVagkant")}</vs_luft:luftIntagAvståndFasadVägkant>
					<vs_luft:luftIntagAvståndVägkorsning>{fme:get-attribute("B2Info_avstandVagkors")}</vs_luft:luftIntagAvståndVägkorsning>
					<vs_luft:luftIntagHojd>{fme:get-attribute("B2Info_hojdOverMark")}</vs_luft:luftIntagHojd>
					<vs_luft:luftIntagPosition>{fme:get-attribute("B2Info_n_kordLuftintag")}</vs_luft:luftIntagPosition>
				</vs_luft:luftIntag>
				<vs_luft:meteorologiskaParametrar></vs_luft:meteorologiskaParametrar>
				<vs_luft:regionalaSpridningsförutsättningar>{fme:get-attribute("B1Info_regionalSpridnings")}</vs_luft:regionalaSpridningsförutsättningar>
				<vs_luft:skyltadHastighet>{fme:get-attribute("B1Info_skyltadHastighet")}</vs_luft:skyltadHastighet>
				<vs_luft:tungTrafik>{fme:get-attribute("B1Info_andelTungTrafik")}</vs_luft:tungTrafik>
				<vs_luft:typAvMätstation>{fme:get-attribute("B1Info_typAvMatplats")}</vs_luft:typAvMätstation>
				<vs_luft:uppmättaParametrar>{fme:get-attribute("fororening")}</vs_luft:uppmättaParametrar>
				<vs_luft:ÅDT>{fme:get-attribute("B1Info_adtVolym")}</vs_luft:ÅDT>
			</vs_core:luftPlatsParameter>
		</vs_core:platsspecifikParameter>
		<vs_core:tillfällesspecifikParameter>
			<vs_core:luftTillfällesspecifikParameter>
				<vs_luft:dataFångst></vs_luft:dataFångst>
				<vs_luft:kvalitetsprogram>{fme:get-attribute("AllmanInfo_kvalitetProgram")}</vs_luft:kvalitetsprogram>
				<vs_luft:maxHalt>{fme:get-attribute("maxhalt")}</vs_luft:maxHalt>
				<vs_luft:minHalt>{fme:get-attribute("minhalt")}</vs_luft:minHalt>
				<vs_luft:programSamordnadKontroll>true</vs_luft:programSamordnadKontroll>
				<vs_luft:tidsreferens>lokalTid</vs_luft:tidsreferens>
				<vs_luft:tidstäckning>{fme:get-attribute("tidstackning")}</vs_luft:tidstäckning>
			</vs_core:luftTillfällesspecifikParameter>
		</vs_core:tillfällesspecifikParameter>
	</vs_core:parameter>
	<vs_core:observedProperty>miljögifterILuft</vs_core:observedProperty>
	<vs_core:featureOfInterest></vs_core:featureOfInterest>
	<vs_core:result>
		<vs_core:resultat>
			<swe:elementCount>
				<swe:Count>
					<swe:value>{fme:get-attribute("matningar")}</swe:value>
				</swe:Count>
			</swe:elementCount>
			<swe:elementType name="fixedObservation"></swe:elementType>
			<swe:encoding>
				<swe:TextEncoding blockSeparator="@@" decimalSeparator="," tokenSeparator=";"/>
			</swe:encoding>
			<swe:values>
				{fme:get-attribute("_concatenated")}
			</swe:values>
		</vs_core:resultat>
	</vs_core:result>
	<vs_core:metadata>
		<vs_core:beställare>
			<base2:individualName>
				<gco:CharacterString>Matthew Ross-Jones</gco:CharacterString>
			</base2:individualName>
			<base2:organisationName>
				<gco:CharacterString>Naturvårdsverket</gco:CharacterString>
			</base2:organisationName>
		</vs_core:beställare>
		<vs_core:datavärd>
			<base2:organisationName>
				<gco:CharacterString>SMHI</gco:CharacterString>
			</base2:organisationName>
			<base2:contact>
				<base2:Contact>
					<base2:electronicMailAddress>datavardluft@smhi.se</base2:electronicMailAddress>
					<base2:telephoneVoice>018-100 100</base2:telephoneVoice>
					<base2:website>http://www.smhi.se</base2:website>
				</base2:Contact>
			</base2:contact>
		</vs_core:datavärd>
		<vs_core:sekretess>false</vs_core:sekretess>
		<vs_core:status>preliminära</vs_core:status>
		<vs_core:syfte>Miljöövervakning</vs_core:syfte>
		<vs_core:utförare>
			<base2:individualName>
				<gco:CharacterString>{fme:get-attribute("AllmanInfo_namnRapportor")}</gco:CharacterString>
			</base2:individualName>
			<base2:contact>
				<base2:Contact>
					<base2:electronicMailAddress>{fme:get-attribute("AllmanInfo_epost")}</base2:electronicMailAddress>
					<base2:telephoneVoice>{fme:get-attribute("AllmanInfo_teleNr")}</base2:telephoneVoice>
					<base2:website>{fme:get-attribute("AllmanInfo_adressWebbplats")}</base2:website>
				</base2:Contact>
			</base2:contact>
		</vs_core:utförare>
	</vs_core:metadata>
</vs_core:vs_Observation>



david_r
Celebrity
  • Best Answer
  • March 18, 2016

Try removing the comment on line 2:

<!--Sample XML file generated by XMLSpy v2016 sp1 (x64) (http://www.altova.com)-->

The XMLTemplater seems to have issues with it, and I suspect you don't really need it?

David


Forum|alt.badge.img
  • Author
  • March 18, 2016
david_r wrote:

Try removing the comment on line 2:

<!--Sample XML file generated by XMLSpy v2016 sp1 (x64) (http://www.altova.com)-->

The XMLTemplater seems to have issues with it, and I suspect you don't really need it?

David

You are absolutely right, nice one. So the templater reads into the "comments", that has been noted now =)

Cheers!


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • March 18, 2016

Looks like this is a known issue. PR#66471 and PR#26656 are the reference numbers in case you need to check with us. They are flagged for fixing in FME2017, so here's hoping.


chriswilson
Supporter
Forum|alt.badge.img+11
  • Supporter
  • October 24, 2017
mark2atsafe wrote:

Looks like this is a known issue. PR#66471 and PR#26656 are the reference numbers in case you need to check with us. They are flagged for fixing in FME2017, so here's hoping.

Hi @Mark2AtSafe, I'm working in 2017.1.1 (build 17650) and have also just had this issue come up, so it doesn't appear to be fixed in 2017. Again it is objecting to a commented line, which will be problematic as the XML I am trying to work with contains comments left, right and centre.

 


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • October 24, 2017
chriswilson wrote:
Hi @Mark2AtSafe, I'm working in 2017.1.1 (build 17650) and have also just had this issue come up, so it doesn't appear to be fixed in 2017. Again it is objecting to a commented line, which will be problematic as the XML I am trying to work with contains comments left, right and centre.

 

Yes, I checked and it got bumped. I've added your details and increased the priority, which is about as much as I can do to force the issue. Sorry, I know it must be frustrating. But the status is now "in progress" at least. If you don't have a good workaround then let me know and I can ask the developer what we can do to avoid the error.

 


chriswilson
Supporter
Forum|alt.badge.img+11
  • Supporter
  • October 25, 2017
mark2atsafe wrote:
Yes, I checked and it got bumped. I've added your details and increased the priority, which is about as much as I can do to force the issue. Sorry, I know it must be frustrating. But the status is now "in progress" at least. If you don't have a good workaround then let me know and I can ask the developer what we can do to avoid the error.

 

Workaround is to remove the commented lines as @david_r advised below, which isn't great but it does allow the XML to be created.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings