matthiasblaesing commented on issue #9243: URL: https://github.com/apache/netbeans/issues/9243#issuecomment-4000292788
This is not a general problem as for example Tomcat 10 happily deploys the example application and also parses the web.xml. I validated that by adding `context-param` elements to `web.xml` and changing `session-timeout` and read these values successfully from a JSP page. Why do you think this is an issue rooted in NetBeans and not in OpenEJB? Let me explain: - we need to examine the XML schema for the file. That is references from the root element and is `https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd`. - that schema does not hold the definition for `session-timeout`, so we follow the import into `https://jakarta.ee/xml/ns/jakartaee/web-common_6_0.xsd` - There `session-timeout` is typed as `jakartaee:xsdIntegerType`, so we need to locate that - That type can be found in the import `https://jakarta.ee/xml/ns/jakartaee/jakartaee_10.xsd` - The type is an extension of `xsd:integer` - For the definition of `xsd:integer` I would checl the XML Schema spec and land here: https://www.w3.org/TR/xmlschema-2/ - There `integer` is defined to be derived from `decimal`, which in turn is a basic type, ok, not too helpful - But the documentation of `decimal` links to `whiteSpace` (Section 4.3.6) and here it becomes interesting. > whiteSpace is applicable to all [·atomic·](https://www.w3.org/TR/xmlschema-2/#dt-atomic) and [·list·](https://www.w3.org/TR/xmlschema-2/#dt-list) datatypes. For all [·atomic·](https://www.w3.org/TR/xmlschema-2/#dt-atomic) datatypes other than [string](https://www.w3.org/TR/xmlschema-2/#string) (and types [·derived·](https://www.w3.org/TR/xmlschema-2/#dt-derived) by [·restriction·](https://www.w3.org/TR/xmlschema-2/#dt-restriction) from it) the value of whiteSpace is collapse and cannot be changed by a schema author; My understanding that `integer` qualifies as atomic. And thus whitespace handling `collapse` applies: > **replace** > All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space) > **collapse** > After the processing implied by replace, contiguous sequences of #x20's are collapsed to a single #x20, and leading and trailing #x20's are removed. For the concrete case in the default `web.xml`: ```xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" version="6.0"> <session-config> <session-timeout> 30 </session-timeout> </session-config> </web-app> ``` we find the sequence: "newline", "a few spaces", "the numbers 3 and 0", "a few spaces" "newline", "a few spaces" as the content of `session-timeout`. Applying `replace` we reach "a few spaces", "the number 3 and 0", "a few spaces". Applying `collapse` we reach "the numbers 3 and 0". That in turn should parse cleanly as an integer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
