I realized that some css are not applied on my page if I use bundling some less and css files.
yield return new StyleBundle("~/app/son/styles")
.Include(
"~/angular/angular-ui-select/select.css",
"~/less/bootstrap-slider.less",
"~/less/less/bootstrap-switch.less",
"~/less/employee.less");
When I check the applied less page it s giving an error like that:
Minification failed. Returning unminified contents.
(248,6): run-time error CSS1035: Expected colon, found '{'
(291,5): run-time error CSS1035: Expected colon, found 'input'
(298,5): run-time error CSS1035: Expected colon, found 'input'
(309,5): run-time error CSS1035: Expected colon, found '{'
(326,12): run-time error CSS1035: Expected colon, found '{'
For example for first error line is like that
248.line(pre {):
.example {
pre {
font-size: 14px;
}
And 298 line (td input[type="number"]):
.large-rows {
td input[type="number"] {
width: 120px;
margin-left: 4px;
}
}
As I understand my less file does not behave as less file. why I m getting these errors?
Related
Given the below super simple grammar:
ddlStatement
: defineStatement
;
defineStatement
: 'define' tableNameToken=Identifier ';'?
;
and the input "add 1 to bob"
I would expect to get an error. However, the parser matches the "defineStatement" rule with a missing "define" token. The following Listener will fire
#Override
public void exitDefineStatement(DDLParser.DefineStatementContext ctx) {
log.info(MessageFormat.format("Defining {0}", ctx.tableNameToken.getText()));
}
and log "Defining add".
I can assign 'define' to a variable and test that variable for NULL but that seems like work I shouldn't have to do.
BTW if the grammar becomes more complete - specifically with the addition of alternatives to the ddlStatement rule - error handling works as I would expect.
This ANTLR's error recovery in action.
In many cases, it's VERY beneficial for ANTLR to assume either a missing token, or ignore a token, if it allows parsing to continue. The missing "define" token should have been reported as an error.
Without this capability, ANTLR would frequently get "stumped" at the first sign of problems. With this, ANTLR is saying "Well, if I assume X, then I can make sense of your input. So I'm assuming X and reporting that as an error so I can continue on.
(Filling a few details to get this to build)
grammar Test
;
ddlStatement: defineStatement;
defineStatement: 'define' tableNameToken = Identifier ';'?;
Identifier: [a-zA-Z]+;
Number: [0-9]+;
WS: [ \r\n\t]+ -> skip;
if I run antlr on this and compile the Java output. The following command:
echo "add 1 to bob" | grun Test ddlStatement -gui
yields the error:
line 1:0 missing 'define' at 'add'
and produces the parse tree:
The highlighted node is the error node in the tree.
The reason it stops after "add" is that input (assuming a missing "define", would be a ddlStatement
ANTLR will stop processing input once it has recognized your stop rule.
To get it to "pay attention" to the entire input, add an EOF token to your start rule:
grammar Test
;
ddlStatement: defineStatement EOF;
defineStatement: 'define' tableNameToken = Identifier ';'?;
Identifier: [a-zA-Z]+;
Number: [0-9]+;
WS: [ \r\n\t]+ -> skip;
gives these errors:
line 1:0 missing 'define' at 'add'
line 1:4 mismatched input '1' expecting {<EOF>, ';'}
and this tree:
I have a form with multiple input fields, when I add an extra field (I just copy paste the code from one of the above) I get the following error:
Uncaught Error: "XL0 L0 M0 S12" is of type string, expected >sap.ui.layout.GridSpan for property "span" of Element >sap.ui.layout.GridData#__layout10--Dummy
On: ManagedObject-dbg.js:1183 (this is an UI5 javascript file, so I have no control over it)
The code I use in my XML-view is, I use this code for a couple other dropdownboxes.
<commons:DropdownBox id="settingRetour_status" items="{statusses>/}" valueStateText="{i18n>RequiredField}" selectedKey="{settingDetail>/value}" displaySecondaryValues="false" searchHelpEnabled="true" visible="false">
<commons:items>
<core:ListItem key="{statusses>code}" text="{statusses>description}" additionalText="{statusses>id}" />
</commons:items>
</commons:DropdownBox>
The gridLayout looks like
<form:layout>
<form:ResponsiveGridLayout labelSpanL="{settings>/ProductDetailFormLabelSpanL}" labelSpanM="{settings>/ProductDetailFormLabelSpanM}"
breakpointL="{settings>/ProductDetailFormBreakpointL}" breakpointM="{settings>/ProductDetailFormBreakpointM}"
columnsL="{settings>/ProductDetailFormColumnsL}" columnsM="{settings>/ProductDetailFormColumnsM}"/>
</form:layout>
Why do I get this error?
And how can I prevent getting it?
I use openui5-1.42.6 in Eclipse and run it in Chrome
The problem was with the grid layout.
I was adding to many elements to be displayed on one row. There are 12 columns and I added a 13th item, that resulted in an unknown column S12 but because all but one were visible="false" I couldn't see this.
After adding a vertical layout to my formcontainer-element the problem was solved.
I have Customer.io account for emails which collects emails from test server.
There in an iframe where there needed elements. But I can't get to them. If I use:
page.in_iframe(xpath: "//iframe[contains(#class, 'ember-view')]") do |frame|
page.cell_element(xpath: "//td[contains(text(), 'Order Confirmation')]", frame: frame).when_present(30)
end
Then I get next error:
SyntaxError: (eval):1: syntax error, unexpected tIDENTIFIER, expecting ')'
.../iframe[contains(#class, 'ember-view')]').td(identifier)
... ^
(eval):1: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
...e[contains(#class, 'ember-view')]').td(identifier)
... ^
(eval):1: syntax error, unexpected ')', expecting end-of-input
...ntains(#class, 'ember-view')]').td(identifier)
...
And if I use this:
page.in_iframe(xpath: "//iframe[contains(#class, ember)]") do |frame|
page.cell_element(xpath: "//td[contains(text(), 'Order Confirmation')]", frame: frame).when_present(30)
end
Then I don't get this error but element couldn't be found.
One of the goals of Watir is to never have to use XPath.
Consider rewriting your locator with regular expressions like this:
#browser.iframe(class: /ember/).td(text: /Order Confirmation/)
The problem appears to be with the parsing of the iframe XPath string. I do not understand why the interpreter is having problems, but here are some solutions:
For the first example, switch to using single quotes as the outer part of the String:
page.in_iframe(xpath: '//iframe[contains(#class, "ember-view")]') do |frame|
page.cell_element(xpath: "//td[contains(text(), 'Order Confirmation')]", frame: frame).when_present(30)
end
For the second example, you do need to quote the attribute value. If you want to stick with double-quotes for the String, you can escape the inner double-quotes:
page.in_iframe(xpath: "//iframe[contains(#class, \"ember\")]") do |frame|
page.cell_element(xpath: "//td[contains(text(), 'Order Confirmation')]", frame: frame).when_present(30)
end
Alternatively, you might want to consider avoiding the XPath problem by using other locators:
page.in_iframe(class: 'ember-view') do |frame|
page.cell_element(text: /Order Confirmation/, frame: frame).when_present(30)
end
I've found another way:
#browser.iframe(xpath: "//iframe[contains(#class,'ember')]").td(xpath: "//td[contains(text(), 'Order Confirmation')]")
Because that examples don't want to work. Don't know why.
But thanks Justin:
Referring property expansion from here
One of the element of the soap request is defined as follows.
<ns:PRODUCTID>${=def list = [12, 13,12];list.join(',')}</ns:PRODUCTID>
And when the request is submitted, it evaluates correctly and sends out the request as below(from the raw request):
<ns:PRODUCTID>12,13,12</ns:PRODUCTID>
However, could not get it working a dynamic value as shown below, i mean it is leading below error
<ns:PRODUCTID>${=def a = (int)(Math.random()*5);def list = [];a.times {list.add((int)(Math.random()*1000))};list.join(',')}</ns:PRODUCTID>
But the same script runs perfectly fine when it is run separately.
Error below:
startup failed:
Script16.groovy: 1: expecting '}', found '' # line 1, column 94.
add((int)(Math.random()*1000))
^
org.codehaus.groovy.syntax.SyntaxException: expecting '}', found '' # line 1, column 94.
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:139)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:107)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:163)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:839)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:544)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:520)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
at groovy.lang.GroovyShell.parse(GroovyShell.java:770)
at groovy.lang.GroovyShell.parse(GroovyShell.java:761)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
at com.eviware.soapui.model.propertyexpansion.resolvers.EvalPropertyResolver.doEval(EvalPropertyResolver.java:191)
at com.eviware.soapui.model.propertyexpansion.resolvers.EvalPropertyResolver.resolveProperty(EvalPropertyResolver.java:170)
at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expand(PropertyExpander.java:180)
at com.eviware.soapui.model.propertyexpansion.PropertyExpander.expandProperties(PropertyExpander.java:113)
at com.eviware.soapui.impl.wsdl.submit.filters.PropertyExpansionRequestFilter.filterWsdlRequest(PropertyExpansionRequestFilter.java:45)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterAbstractHttpRequest(AbstractRequestFilter.java:37)
at com.eviware.soapui.impl.wsdl.submit.filters.AbstractRequestFilter.filterRequest(AbstractRequestFilter.java:31)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:184)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: Script16.groovy:1:94: expecting '}', found ''
at groovyjarjarantlr.Parser.match(Parser.java:211)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.closableBlock(GroovyRecognizer.java:8620)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.appendedBlock(GroovyRecognizer.java:11397)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathElement(GroovyRecognizer.java:11349)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathExpression(GroovyRecognizer.java:11464)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.postfixExpression(GroovyRecognizer.java:13175)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.unaryExpressionNotPlusMinus(GroovyRecognizer.java:13144)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.powerExpressionNotPlusMinus(GroovyRecognizer.java:12848)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multiplicativeExpression(GroovyRecognizer.java:12780)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.additiveExpression(GroovyRecognizer.java:12450)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.shiftExpression(GroovyRecognizer.java:9664)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.relationalExpression(GroovyRecognizer.java:12355)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.equalityExpression(GroovyRecognizer.java:12279)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.regexExpression(GroovyRecognizer.java:12227)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.andExpression(GroovyRecognizer.java:12195)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.exclusiveOrExpression(GroovyRecognizer.java:12163)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.inclusiveOrExpression(GroovyRecognizer.java:12131)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalAndExpression(GroovyRecognizer.java:12099)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalOrExpression(GroovyRecognizer.java:12067)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.conditionalExpression(GroovyRecognizer.java:4842)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.assignmentExpression(GroovyRecognizer.java:7988)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expression(GroovyRecognizer.java:9841)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatementNoCheck(GroovyRecognizer.java:8314)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatement(GroovyRecognizer.java:8739)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1274)
at org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit(GroovyRecognizer.java:757)
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:130)
... 30 more
1 error
;list.join(',')}
Seems that in property expansion the curly braces {} are not allowed inside ${= ... } because ${= close with any } character from any closure, loop, method.. you try to add it.
Also trying to escape the close \} inside ${= ... } does not help.
You can not even use } in a String, the follow code throws the same exception in SOAPUI:
<ns:PRODUCTID>${=return '}'}</ns:PRODUCTID>
The only way that you can use } here seems that is nesting expression like ${= ... ${= ... } }. For example the follow nested exceptions works:
<ns:PRODUCTID>${= 5 + ${= 3+4 } }</ns:PRODUCTID>
// in raw View you will see <ns:PRODUCTID>12</ns:PRODUCTID>
However they also can not help because individually each one has the same problem with } from closures, loops, methods.
Seems that the parser for property expansion which implements SOAPUI can not deal with this. Good catch, maybe you can request a new feature.
I don't add a workaround using groovy script to save the result in a property, and then use it in your request since I'm totally sure that you know how to do it :)
I don't see where the syntax error is either. But try this:
(0..(Math.random() * 5 as Integer)).collect { Math.random() * 1000 as Integer }.join(',')
I'm trying to get google map image with the following code:
<img src="http://maps.googleapis.com/maps/api/staticmap?center=#{profile.latitude},#{profile.longitude}&zoom=14&size=400x400&sensor=false"/>
but I get exception in my browser which says:
Error Parsing /content/profile.xhtml:
Error Traced [line: 48] The reference to entity "zoom" must end with the ';' delimiter.
How can I avoid interpreting & in URL as XML?
Replace & with & as the markup is being parsed as XML and &zoom is being parsed as an HTML entity which does not exist in XML.