Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
spring-conversion-xml-parser
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher Cottier
spring-conversion-xml-parser
Commits
2b45023b
Commit
2b45023b
authored
Jul 21, 2021
by
Christopher Cottier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xml scraping with groovy practice
parent
b4db64d9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
0 deletions
+74
-0
.DS_Store
.DS_Store
+0
-0
XMLParser.class
out/production/spring-conversion-xml-parser/XMLParser.class
+0
-0
web.xml
out/production/spring-conversion-xml-parser/web.xml
+31
-0
XMLParser.groovy
src/XMLParser.groovy
+12
-0
web.xml
src/web.xml
+31
-0
No files found.
.DS_Store
0 → 100644
View file @
2b45023b
File added
out/production/spring-conversion-xml-parser/XMLParser.class
0 → 100644
View file @
2b45023b
File added
out/production/spring-conversion-xml-parser/web.xml
0 → 100644
View file @
2b45023b
<?xml version="1.0" encoding="UTF-8" ?>
<web-app
xmlns=
"http://java.sun.com/xml/ns/javaee"
version=
"2.5"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>
<!-- The definition of the Root Spring Container shared by all Servlets, basically provides parameters to the entire web application-->
<!--see https://docs.spring.io/spring-framework/docs/3.0.0.M3/reference/html/ch19s02.html-->
<context-param>
<!--param gives the location of the root context.-->
<param-name>
contextConfigLocation
</param-name>
<param-value>
/WEB-INF/web-context.xml
</param-value>
</context-param>
<!-- root web-application-context for the web-application and puts it in the ServletContext-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>
dispatcher
</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>
1
</load-on-startup>
</servlet>
<!-- specifies which java servlet should be invoked for a url-->
<servlet-mapping>
<servlet-name>
dispatcher
</servlet-name>
<url-pattern>
/
</url-pattern>
</servlet-mapping>
</web-app>
\ No newline at end of file
src/XMLParser.groovy
View file @
2b45023b
import
groovy.xml.XmlSlurper
def
webApp
=
new
XmlSlurper
().
parse
(
"./web.xml"
)
//assert webApp instanceof groovy.util.Node
def
listenerClass
=
webApp
.
'listener'
.
'listener-class'
.
toString
()
println
(
listenerClass
)
def
listenerClass2
=
webApp
[
'@version'
]
println
(
listenerClass2
)
src/web.xml
0 → 100644
View file @
2b45023b
<?xml version="1.0" encoding="UTF-8" ?>
<web-app
xmlns=
"http://java.sun.com/xml/ns/javaee"
version=
"2.5"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>
<!-- The definition of the Root Spring Container shared by all Servlets, basically provides parameters to the entire web application-->
<!--see https://docs.spring.io/spring-framework/docs/3.0.0.M3/reference/html/ch19s02.html-->
<context-param>
<!--param gives the location of the root context.-->
<param-name>
contextConfigLocation
</param-name>
<param-value>
/WEB-INF/web-context.xml
</param-value>
</context-param>
<!-- root web-application-context for the web-application and puts it in the ServletContext-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>
dispatcher
</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>
1
</load-on-startup>
</servlet>
<!-- specifies which java servlet should be invoked for a url-->
<servlet-mapping>
<servlet-name>
dispatcher
</servlet-name>
<url-pattern>
/
</url-pattern>
</servlet-mapping>
</web-app>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment