Giter VIP home page Giter VIP logo

broken-xml's People

Contributors

guseyn avatar yegor256 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

guseyn

broken-xml's Issues

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 at com.guseyn.broken_xml.ParsedXML.document(ParsedXML.java:297)

<?xml version="1.0" encoding="UTF-8"?>

<!-- ~ Copyright 2010-2012 Luca Garulli (l.garulli(at)orientechnologies.com) 
    ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you 
    may not use this file except in compliance with the License. ~ You may obtain 
    a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ 
    ~ Unless required by applicable law or agreed to in writing, software ~ distributed 
    under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES 
    OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for 
    the specific language governing permissions and ~ limitations under the License. -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.orientechnologies</groupId>
        <artifactId>orientdb-parent</artifactId>
        <version>3.0.0-SNAPSHOT</version>
        <relativePath>../</relativePath>
    </parent>

    <artifactId>orientdb-community</artifactId>
    <!--<packaging>pom</packaging>-->

    <name>OrientDB Community Distribution</name>

    <properties>
        <VERSION>${project.version}</VERSION>
        <BUILD>${implementation.build}; ${maven.build.timestamp}</BUILD>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-test-commons</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-client</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-server</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-object</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-tools</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-distributed</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-etl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-lucene</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-jdbc</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.orientechnologies</groupId>
            <artifactId>orientdb-studio</artifactId>
            <version>${project.version}</version>
            <type>zip</type>
        </dependency>


    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.4.0</version>
                <executions>
                    <execution>
                        <id>build-db</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>${java.home}/bin/java</executable>
                            <workingDirectory>${project.basedir}</workingDirectory>
                            <arguments>
                                <argument>-XX:MaxDirectMemorySize=512g</argument>
                                <argument>-classpath</argument>
                                <classpath/>
                                <argument>com.orientechnologies.orient.console.OConsoleDatabaseApp</argument>
                                <argument>./src/test/resources/demoDB.osql</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <id>start-orient</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target name="start">
                                <exec executable="${project.build.directory}/${project.build.finalName}.dir/${project.build.finalName}/bin/server.sh"
                                      spawn="true">
                                    <env key="ORIENTDB_ROOT_PASSWORD" value="rootpasswd"/>
                                </exec>
                            </target>
                        </configuration>
                    </execution>

                    <execution>
                        <id>stop-orient</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <exec executable="${project.build.directory}/${project.build.finalName}.dir/${project.build.finalName}/bin/shutdown.sh"
                                      spawn="false">
                                    <!--<env key="ORIENTDB_ROOT_PASSWORD" value="rootpasswd"/>-->
                                </exec>

                            </target>
                        </configuration>

                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>distribution-package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>${basedir}/src/main/assembly/archive.xml</descriptor>
                            </descriptors>
                            <filters>
                                <filter></filter>
                            </filters>
                            <ignoreDirFormatExtensions>false</ignoreDirFormatExtensions>
                            <tarLongFileMode>gnu</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.4.13</version>
                <configuration>
                    <imageName>orientdb/orientdb</imageName>
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                    </imageTags>
                    <dockerDirectory>docker</dockerDirectory>
                    <!-- copy the service's jar file from target into the root directory of the image -->
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}/</directory>
                            <include>${project.build.finalName}.tar.gz</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Could not build the project in kali

It failed at this test:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project broken-xml: There are test failures.

parse invalid xml: cases

When it does make sense to parse invalid xml, cases

Knowing that XML elements must follow these naming rules:

  • Element names are case-sensitive
  • Element names must start with a letter or underscore
  • Element names cannot start with the letters xml (or XML, or Xml, etc)
  • Element names can contain letters, digits, hyphens, underscores, and periods
  • Element names cannot contain spaces

We can make rules for fixing xml for following cases.

Escape brackets < and > inside of elements when they are part of words that are surrounded by spaces or breaklines.

<!-- invalid -->
<elm><fsdfsdf </elm>
<!-- valid -->
<elm>&lt;<fsdfsdf </elm>
  
<!-- invalid -->
<elm>< fsdfsdf ></elm>
<!-- valid -->
<elm>&lt; fsdfsdf &gt;</elm>

Escape brackets < and > inside of attributes when they are surrounded by ".

<!-- invalid -->
<elm attr="><"> </elm>
<!-- valid -->
<elm attr="&lt;&gt;"> </elm>
  
<!-- invalid -->
<elm>< fsdfsdf ></elm>
<!-- valid -->
<elm>&lt; fsdfsdf &gt;</elm>

Escape brackets < and > inside of elements when they are part of words with no charaters.

<!-- invalid -->
<elm><<<<>>>></elm>
<!-- valid -->
<elm>>&lt;&lt;&lt;&lt;&gt;&gt;&gt;&gt;</elm>

Escape brackets < and > inside of elements when > goes after > or < goes after <.

It's bit dfferent from the case above because here we cannot have sequence < >.

<!-- invalid -->
<elm><a<s<d<f</elm>
<!-- valid -->
<elm>>&lt;a&lt;s&lt;d&lt;f</elm>

<!-- invalid -->
<elm>f>d>s>a></elm>
<!-- valid -->
<elm>f&gt;d&gt;s&gt;a&gt;</elm>

Escape brackets " inside of attributes when they are surrounded by " and after goes a space.

<!-- invalid -->
<elm attr1="asdasd"" attr2="asdasd""> </elm>
<!-- valid -->
<elm>&lt;<fsdfsdf </elm>
  
<!-- invalid -->
<elm>< fsdfsdf ></elm>
<!-- valid -->
<elm>&lt; fsdfsdf &gt;</elm>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.