Uploaded image for project: 'WINDUP - Red Hat Application Migration Toolkit'
  1. WINDUP - Red Hat Application Migration Toolkit
  2. WINDUP-1056

Treat missing DOCTYPE or PUBLIC id as "" public id for <xmlfile public-id="...">

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.5.0.Final
    • None
    • None

      It's quite hard to make a negative check for a DTD ID. That's a broader problem. But for now, we could make it easier by treating missing public ID as "". (This applies to values in general I guess.)
      For instance:

                  <when>
                      <xmlfile matches="//*[local-name()='jboss-app']" in="jboss-app.xml" as="have-jboss-app-root"/>
                      <xmlfile from="have-jboss-app-root" public-id=".*(?!\QJBoss.+DTD Java EE.+5\E).*"/>
                  </when>
      

      This won't pass for XML files that don't have DOCTYPE or PUBLIC id.

      See:

      XmlFileDtdValidator
      
          @Override public boolean isValid(GraphRewrite event,EvaluationContext context, XmlFileModel model)
          {
              if (( publicId != null && !publicId.isEmpty() ) || systemId!=null)
              {
                  DoctypeMetaModel doctype = model.getDoctype();
                  if (doctype == null )
                  {
                      return false;
                  }
                  if(publicId != null && ( (doctype.getPublicId() == null) || !doctype.getPublicId().matches(publicId))) {
                      return false;
                  }
                  if(systemId != null && ( (doctype.getSystemId() == null) || !doctype.getSystemId().matches(systemId))) {
                      return false;
                  }
      
              }
              return true;
          }
      
      

              Unassigned Unassigned
              ozizka_jira Ondrej Zizka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: