-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML File Patching - SyntaxError: Unexpected number #40
Comments
Can you share the input xml?
Le jeu. 24 août 2017 à 04:38, zaengi <[email protected]> a écrit :
… Using Slick Syntax on your newest toolset version (Version 2.2.999) leads
to an error, which I rather cant debug.
2017-08-23T18:24:12.4598851Z Set workingFolder to default:
C:\vsoAgent\tasks\XmlPatch\2.2.999
2017-08-23T18:24:12.9039025Z ##[debug]agent.workFolder=C:\vsoAgent_work
2017-08-23T18:24:12.9039025Z ##[debug]loading inputs and endpoints
2017-08-23T18:24:12.9049040Z ##[debug]loading ENDPOINT_AUTH_$/
2017-08-23T18:24:12.9059043Z ##[debug]loading
ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2017-08-23T18:24:12.9059043Z ##[debug]loading INPUT_FAILIFNOPATCHAPPLIED
2017-08-23T18:24:12.9069047Z ##[debug]loading INPUT_JSONPATCHCONTENT
2017-08-23T18:24:12.9069047Z ##[debug]loading INPUT_OUTPUTPATCHFILE
2017-08-23T18:24:12.9079019Z ##[debug]loading INPUT_SKIPERRORS
2017-08-23T18:24:12.9079019Z ##[debug]loading INPUT_SYNTAXTYPE
2017-08-23T18:24:12.9089036Z ##[debug]loading INPUT_XMLTARGETFILTERS
2017-08-23T18:24:12.9089036Z ##[debug]loading INPUT_XMLWORKINGDIR
2017-08-23T18:24:12.9099049Z ##[debug]loaded 9
2017-08-23T18:24:13.0879138Z ##[debug]XmlWorkingDir=C:\vsoAgent_work\1\s
2017-08-23T18:24:13.0889663Z ##[debug]JsonPatchContent== ***@***.***
***@***.*** <https://github.com/value>
=> "dfg"
2017-08-23T18:24:13.0889663Z = ***@***.*** <https://github.com/name>
***@***.*** <https://github.com/value> => "\tst\00_satlogs"
2017-08-23T18:24:13.0889663Z = ***@***.*** <https://github.com/name>
***@***.*** <https://github.com/value> =>
"\Release-trunk\drop
2017-08-23T18:24:13.0899706Z ##[debug]OutputPatchFile=true
2017-08-23T18:24:13.0909256Z ##[debug]FailIfNoPatchApplied=true
2017-08-23T18:24:13.0909256Z ##[debug]SkipErrors=false
2017-08-23T18:24:13.0919119Z ##[debug]SyntaxType=slick
2017-08-23T18:24:13.0919119Z ##[debug]XmlTargetFilters=*.runsettings
2017-08-23T18:24:13.0929234Z ##[debug]Namespaces=null
2017-08-23T18:24:13.0959144Z ##[debug]task result: Failed
2017-08-23T18:24:13.0969127Z SyntaxError: Unexpected number
2017-08-23T18:24:13.1039139Z ##[error]SyntaxError: Unexpected number
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#40>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACiXplxmZ1_u7WHrStNKtnCRSVFt77jQks5sbHGigaJpZM4PAasx>
.
|
it's a normal VS2015 *.runsettings file, excerpt given here: |
There's something weird about the last line of your patch in your logs, it's missing a double quote: We plan on improving those kind of error detection as Microsoft released so validation api for tasks parameters 🎉 |
Thanks for that good input, it was wrong but didnt solve the problem: 2017-08-31T14:11:39.1871172Z = //Parameter[@name='testOutDir']/@value => "\tst\00_satlogs" How can I use "Standard Syntax" instead of "Slick" with XML files? |
Found the cause it's the same as #4, you have backslashes in your values so they have to be escaped.
Regarding the standard Syntax, I woudn't recommend it as it's very verbose. However if you really want to use it, you have samples in the tests : https://github.com/geeklearningio/gl-vsts-tasks-file-patch/blob/master/Tests/XmlPatch/xmlPatcher.spec.ts#L100 |
Thanks - that solved the problem! |
yes you are running into the same issue as #4 for that as well and I have to respawn a discussion with vsts team as I really feel uncomfortable introducing a custom syntax to handle escaping. Meanwhile you can use https://marketplace.visualstudio.com/items?itemName=jessehouwing.jessehouwing-vsts-variable-tasks to transform your variable to an escaped version. |
Using Slick Syntax on your newest toolset version (Version 2.2.999) leads to an error, which I rather cant debug.
2017-08-23T18:24:12.4598851Z Set workingFolder to default: C:\vsoAgent\tasks\XmlPatch\2.2.999
2017-08-23T18:24:12.9039025Z ##[debug]agent.workFolder=C:\vsoAgent_work
2017-08-23T18:24:12.9039025Z ##[debug]loading inputs and endpoints
2017-08-23T18:24:12.9049040Z ##[debug]loading ENDPOINT_AUTH_$/
2017-08-23T18:24:12.9059043Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2017-08-23T18:24:12.9059043Z ##[debug]loading INPUT_FAILIFNOPATCHAPPLIED
2017-08-23T18:24:12.9069047Z ##[debug]loading INPUT_JSONPATCHCONTENT
2017-08-23T18:24:12.9069047Z ##[debug]loading INPUT_OUTPUTPATCHFILE
2017-08-23T18:24:12.9079019Z ##[debug]loading INPUT_SKIPERRORS
2017-08-23T18:24:12.9079019Z ##[debug]loading INPUT_SYNTAXTYPE
2017-08-23T18:24:12.9089036Z ##[debug]loading INPUT_XMLTARGETFILTERS
2017-08-23T18:24:12.9089036Z ##[debug]loading INPUT_XMLWORKINGDIR
2017-08-23T18:24:12.9099049Z ##[debug]loaded 9
2017-08-23T18:24:13.0879138Z ##[debug]XmlWorkingDir=C:\vsoAgent_work\1\s
2017-08-23T18:24:13.0889663Z ##[debug]JsonPatchContent== //Parameter[@name='dbServer']/@value => "dfg"
2017-08-23T18:24:13.0889663Z = //Parameter[@name='testOutDir']/@value => "\tst\00_satlogs"
2017-08-23T18:24:13.0889663Z = //Parameter[@name='applicationRootDirectory']/@value => "\Release-trunk\drop
2017-08-23T18:24:13.0899706Z ##[debug]OutputPatchFile=true
2017-08-23T18:24:13.0909256Z ##[debug]FailIfNoPatchApplied=true
2017-08-23T18:24:13.0909256Z ##[debug]SkipErrors=false
2017-08-23T18:24:13.0919119Z ##[debug]SyntaxType=slick
2017-08-23T18:24:13.0919119Z ##[debug]XmlTargetFilters=*.runsettings
2017-08-23T18:24:13.0929234Z ##[debug]Namespaces=null
2017-08-23T18:24:13.0959144Z ##[debug]task result: Failed
2017-08-23T18:24:13.0969127Z SyntaxError: Unexpected number
2017-08-23T18:24:13.1039139Z ##[error]SyntaxError: Unexpected number
The text was updated successfully, but these errors were encountered: