This repository contains a React Native application designed to dynamically render forms based on XML input. It provides users with two functionalities: rendering a form from an uploaded XML file and creating a form based on directly inputted XML. The application is tailored for developers and testers working with dynamic form rendering, XML parsing, and React Native-based mobile solutions.
- Uploading an XML file and rendering the corresponding form.
- Entering XML manually and generating dynamic forms.
- Handling invalid inputs and showcasing the app's robustness.
-
Dynamic Form Rendering:
- Parse XML content and render forms dynamically using
WebView. - Supports field types like text fields, radio buttons, date pickers, and drawing fields.
- Parse XML content and render forms dynamically using
-
Two Input Options:
- File Upload: Select and render forms from XML files.
- Direct XML Input: Enter XML manually via a text editor.
-
Error Handling:
- Detects invalid or empty XML files.
- Provides user-friendly error messages for parsing and file validation.
-
Cross-Platform Compatibility:
- Works seamlessly on both Android and iOS platforms.
-
MainScreen:
- Entry screen containing options to upload XML files or provide direct XML input.
- Includes modals for XML input and buttons for file-based rendering.
-
FormRenderer:
- Dynamically generates and displays forms based on parsed XML content.
-
AppNavigation:
- Navigation stack managing transitions between the
MainScreenandFormRenderer.
- Navigation stack managing transitions between the
- Install Node.js and npm.
- Set up React Native CLI or Expo for your development environment.
- Ensure the mobile device/emulator has access to the file system (for file upload).
- Clone this repository.
- Run
npm installto install dependencies. - Start the React Native server using
npm startorreact-native run-android/run-ios. - Launch the app on your emulator or physical device.
- Ensure the XML is well-formed and adheres to W3C standards.
- Include supported HTML tags to define form components:
- Text fields, radio buttons, date pickers, and drawing areas.
- Save XML files with
.xmlor.txtextensions for successful uploads.
- Invalid File Type: Alerts the user and restricts processing.
- Empty XML File: Prompts the user to upload a valid file.
- Improper XML Format: Provides error messages highlighting the issue.
Contributions are welcome!
- Fork the repository.
- Create a new branch for your feature/fix.
- Submit a pull request with detailed descriptions of changes.
This project is licensed under the MIT License.
For queries or suggestions, please reach out to the repository maintainer.
